correct for earlier versions of ruby

This commit is contained in:
Sam Saffron 2016-03-17 08:53:48 +11:00
parent 7acdbc8448
commit e947c3b9ec
1 changed files with 3 additions and 1 deletions

View File

@ -22,10 +22,12 @@ describe PostOwnerChanger do
it "changes the user" do it "changes the user" do
bumped_at = topic.bumped_at bumped_at = topic.bumped_at
freeze_time 2.days.from_now
old_user = p1.user old_user = p1.user
PostOwnerChanger.new(post_ids: [p1.id], topic_id: topic.id, new_owner: user_a, acting_user: editor).change_owner! PostOwnerChanger.new(post_ids: [p1.id], topic_id: topic.id, new_owner: user_a, acting_user: editor).change_owner!
p1.reload p1.reload
expect(p1.topic.bumped_at).to eq(bumped_at) expect(p1.topic.bumped_at).to be_within(1.second).of (bumped_at)
expect(p1.topic.last_post_user_id).to eq(user_a.id) expect(p1.topic.last_post_user_id).to eq(user_a.id)
expect(old_user).not_to eq(p1.user) expect(old_user).not_to eq(p1.user)
expect(p1.user).to eq(user_a) expect(p1.user).to eq(user_a)