From 226f1bbfc3f0847afd86e12047f27b221060b8e9 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Mon, 6 Oct 2014 02:39:53 +0200 Subject: [PATCH] Convert activity stream cuke --- features/desktop/activity_stream.feature | 23 ----------------------- spec/lib/stream/activity_spec.rb | 11 ++++++++++- 2 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 features/desktop/activity_stream.feature diff --git a/features/desktop/activity_stream.feature b/features/desktop/activity_stream.feature deleted file mode 100644 index d7ba1a2ae..000000000 --- a/features/desktop/activity_stream.feature +++ /dev/null @@ -1,23 +0,0 @@ -@javascript -Feature: The activity stream - Scenario: Sorting - Given a user with username "bob" - When I sign in as "bob@bob.bob" - - And I click the publisher and post "A- I like turtles" - And I click the publisher and post "B- barack obama is your new bicycle" - And I click the publisher and post "C- barack obama is a square" - - When I go to the activity stream page - Then "C- barack obama is a square" should be post 1 - And "B- barack obama is your new bicycle" should be post 2 - And "A- I like turtles" should be post 3 - - When I like the post "A- I like turtles" - And I comment "Sassy sawfish" on "C- barack obama is a square" - And I like the post "B- barack obama is your new bicycle" - - When I go to the activity stream page - Then "B- barack obama is your new bicycle" should be post 1 - And "C- barack obama is a square" should be post 2 - And "A- I like turtles" should be post 3 diff --git a/spec/lib/stream/activity_spec.rb b/spec/lib/stream/activity_spec.rb index fc77feeca..bb066a3f8 100644 --- a/spec/lib/stream/activity_spec.rb +++ b/spec/lib/stream/activity_spec.rb @@ -3,10 +3,19 @@ require Rails.root.join('spec', 'shared_behaviors', 'stream') describe Stream::Activity do before do - @stream = Stream::Activity.new(alice, :max_time => Time.now, :order => 'updated_at') + @stream = Stream::Activity.new(alice) end describe 'shared behaviors' do it_should_behave_like 'it is a stream' end + + describe "#posts" do + it "calls EvilQuery::Participation with correct parameters" do + expect(::EvilQuery::Participation).to receive(:new) + .with(alice) + .and_return(double.tap { |m| allow(m).to receive(:posts)}) + @stream.posts + end + end end