Convert close mentioned account cuke

This commit is contained in:
Steffen van Bergerem 2014-10-10 01:59:16 +02:00
parent 226f1bbfc3
commit a12ca511c3
2 changed files with 11 additions and 19 deletions

View file

@ -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"

View file

@ -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')