From f4136d45599ee9a97031204a45cc739dbf527505 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 6 Aug 2017 22:47:33 +0200 Subject: [PATCH] Fix post spec * don't use `double` for queries * use `second` instead of `at()`. --- spec/models/post_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 550fdc74d..fdfc1f4b4 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -65,12 +65,12 @@ describe Post, :type => :model do it 'calls includes_for_a_stream' do expect(Post).to receive(:includes_for_a_stream) - Post.for_a_stream(double, double) + Post.for_a_stream(Time.zone.now, "created_at") end it 'calls excluding_blocks if a user is present' do expect(Post).to receive(:excluding_blocks).with(alice).and_return(Post) - Post.for_a_stream(double, double, alice) + Post.for_a_stream(Time.zone.now, "created_at", alice) end end @@ -168,7 +168,7 @@ describe Post, :type => :model do it "returns them in reverse creation order" do posts = Post.for_visible_shareable_sql(Time.now + 1, "created_at") expect(posts.first.text).to eq("second") - expect(posts.at(1).text).to eq("first") + expect(posts.second.text).to eq("first") expect(posts.last.text).to eq("alice - 5") end end