Merge branch 'next-minor' into develop

This commit is contained in:
Steffen van Bergerem 2016-09-05 22:44:57 +02:00
commit 16fc0ec015
No known key found for this signature in database
GPG key ID: 2F08F75F9525C7E0
4 changed files with 9 additions and 11 deletions

View file

@ -31,5 +31,4 @@ Given /^"([^"]*)" has commented a lot on "([^"]*)"$/ do |email, post_text|
user.comment!(post, "Comment #{n}")
end
end
Timecop.return
end

View file

@ -72,8 +72,6 @@ describe EvilQuery::Participation do
alice.comment!(@status_messageE, "party")
end
Timecop.return
end
let(:posts) {EvilQuery::Participation.new(alice).posts}

View file

@ -68,11 +68,11 @@ describe Comment, type: :model do
describe "interacted_at" do
it "sets the interacted at of the parent to the created at of the comment" do
Timecop.travel(Time.zone.now + 1.minute)
comment = Comment::Generator.new(alice, status_bob, "why so formal?").build
comment.save
expect(status_bob.reload.interacted_at.to_i).to eq(comment.created_at.to_i)
Timecop.freeze(Time.zone.now + 1.minute) do
comment = Comment::Generator.new(alice, status_bob, "why so formal?").build
comment.save
expect(status_bob.reload.interacted_at.to_i).to eq(comment.created_at.to_i)
end
end
end

View file

@ -47,9 +47,10 @@ describe Like, type: :model do
it "doesn't change the interacted at timestamp of the parent" do
interacted_at = status.reload.interacted_at.to_i
Timecop.travel(Time.zone.now + 1.minute)
Like::Generator.new(alice, status).build.save
expect(status.reload.interacted_at.to_i).to eq(interacted_at)
Timecop.travel(Time.zone.now + 1.minute) do
Like::Generator.new(alice, status).build.save
expect(status.reload.interacted_at.to_i).to eq(interacted_at)
end
end
end