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/features/desktop/closes_account.feature b/features/desktop/closes_account.feature index 524714b0b..0388943dd 100644 --- a/features/desktop/closes_account.feature +++ b/features/desktop/closes_account.feature @@ -16,22 +16,3 @@ Feature: Close account When I try to sign in manually Then I should be on the new user session page And I should see a flash message with a warning - - Scenario: post display should not throw error when mention is removed for the user whose account is closed - Given following users exist: - | username | email | - | Bob Jones | bob@bob.bob | - | Alice Smith | alice@alice.alice | - And a user with email "bob@bob.bob" is connected with "alice@alice.alice" - And Alice has a post mentioning Bob - - Then I sign in as "bob@bob.bob" - When I go to the users edit page - And I follow "close_account" - And I put in my password in "close_account_password" in the modal window - And I press "close_account_confirm" in the modal window - And I confirm the alert - Then I should be on the new user session page - When I sign in as "alice@alice.alice" - And I am on the home page - Then I should see "Bob Jones" diff --git a/features/desktop/edits_profile.feature b/features/desktop/edits_profile.feature index 627a37f3f..3db0978e9 100644 --- a/features/desktop/edits_profile.feature +++ b/features/desktop/edits_profile.feature @@ -43,10 +43,3 @@ Feature: editing your profile And I confirm the alert And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload" Then I should see a "img" within "#profile_photo_upload" - - When I go to my new profile page -# #commented out until we bring back the profile info on new profile -# Then I should see "Gender: Fearless" - And I should see "Boba Fett" -# And I should see "Bio: This is a bio" -# And I should see "Birthday: 1986-11-30" diff --git a/features/desktop/tags.feature b/features/desktop/tags.feature deleted file mode 100644 index cf438d97b..000000000 --- a/features/desktop/tags.feature +++ /dev/null @@ -1,13 +0,0 @@ -@javascript -Feature: Interacting with tags - - Background: - Given there is a user "Samuel Beckett" who's tagged "#rockstar" - And I am signed in - And I am on the homepage - - Scenario: Searching for a tag - When I search for "#rockstar" - Then I should be on the tag page for "rockstar" - And I should see "Samuel Beckett" - diff --git a/features/desktop/tags_and_comments.feature b/features/desktop/tags_and_comments.feature deleted file mode 100644 index 35111cc22..000000000 --- a/features/desktop/tags_and_comments.feature +++ /dev/null @@ -1,21 +0,0 @@ -@javascript -Feature: Issue #3382 The comments under postings are missing when using the #tags -view - - Background: - Given a user named "Bob Jones" with email "bob@bob.bob" - And I sign in as "bob@bob.bob" - When I post a status with the text "This is a post with a #tag" - And I am on the homepage - - Scenario: - When I search for "#tag" - Then I should be on the tag page for "tag" - And I should see "This is a post with a #tag" - - Scenario: - When I comment "this is a comment on my post" on "This is a post with a #tag" - And I search for "#tag" - Then I should be on the tag page for "tag" - And I should see "this is a comment on my post" - - diff --git a/features/mobile/edits_profile.feature b/features/mobile/edits_profile.feature index a89d5e2e4..9c7f88bd2 100644 --- a/features/mobile/edits_profile.feature +++ b/features/mobile/edits_profile.feature @@ -44,6 +44,3 @@ Feature: editing the profile in the mobile view And I confirm the alert And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload" Then I should see a "img" within "#profile_photo_upload" - - When I go to my new profile page - And I should see "Boba Fett" diff --git a/features/support/paths.rb b/features/support/paths.rb index 0f5bf7ba2..8ccf11987 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -36,10 +36,6 @@ module NavigationHelpers person_photos_path p when /^my account settings page$/ edit_user_path - when /^my new profile page$/ - person_path(@me.person, :ex => true) - when /^the new stream$/ - stream_path(:ex => true) when /^forgot password page$/ new_user_password_path when /^"(\/.*)"/ diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb index e3f7a6071..246238484 100644 --- a/spec/controllers/posts_controller_spec.rb +++ b/spec/controllers/posts_controller_spec.rb @@ -30,6 +30,17 @@ describe PostsController, :type => :controller do expect(response).to be_success end + it 'succeeds after removing a mention when closing the mentioned user\'s account' do + user = FactoryGirl.create(:user, :username => "user") + alice.share_with(user.person, alice.aspects.first) + msg = alice.build_post :status_message, text: "Mention @{User ; #{user.diaspora_handle}}", :public => true, :to => 'all' + msg.save! + expect(msg.mentioned_people.count).to eq(1) + user.destroy + get :show, "id" => msg.id + expect(response).to be_success + end + it 'renders the application layout on mobile' do get :show, :id => @message.id, :format => :mobile expect(response).to render_template('layouts/application') diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb index f2eef5b72..06ccdf6ea 100644 --- a/spec/controllers/tags_controller_spec.rb +++ b/spec/controllers/tags_controller_spec.rb @@ -47,9 +47,22 @@ describe TagsController, :type => :controller do end end + context 'with a tagged user' do + before do + bob.profile.tag_string = "#cats #diaspora #rad" + bob.profile.build_tags + bob.profile.save! + end + + it 'includes the tagged user' do + get :show, :name => 'cats' + expect(response.body).to include(bob.diaspora_handle) + end + end + context 'with a tagged post' do before do - eve.post(:status_message, text: "#what #yes #hellyes #foo", public: true, to: 'all') + @post = eve.post(:status_message, text: "#what #yes #hellyes #foo tagged post", public: true, to: 'all') end context 'signed in' do @@ -66,6 +79,17 @@ describe TagsController, :type => :controller do get :show, :name => 'hellyes' expect(response.status).to eq(200) end + + it 'includes the tagged post' do + get :show, :name => 'foo' + expect(assigns[:stream].posts.first.text).to include("tagged post") + end + + it 'includes comments of the tagged post' do + alice.comment!(@post, "comment on a tagged post") + get :show, :name => 'foo', :format => 'json' + expect(response.body).to include("comment on a tagged post") + end end context "not signed in" do 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