Skip to content

Commit

Permalink
MS DG; fixed close account cukes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrippi authored and maxwell committed Dec 9, 2011
1 parent 7bf1970 commit 3425939
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 2 additions & 3 deletions app/views/users/edit.html.haml
Expand Up @@ -164,10 +164,9 @@
= link_to t('.download_photos'), "#", :class => "button", :id => "photo-export-button", :title => t('.photo_export_unavailable')

.span-5.last
%h3
%h3
= t('.close_account')
.button
=link_to 'Close Account', '#close_account_pane', :rel => 'facebox'
=link_to 'Close Account', '#close_account_pane', :rel => 'facebox', :class => "button"

.hidden#close_account_pane{:rel => 'facebox'}
#inner_account_delete
Expand Down
20 changes: 12 additions & 8 deletions features/closes_account.feature
Expand Up @@ -8,32 +8,35 @@ Feature: Close Account
Given I am signed in
When I click on my name in the header
And I follow "Settings"
And I put in my password in "close_account_password"
And I follow "Close Account"
And I put in my password in "close_account_password" in the modal window
And I preemptively confirm the alert
And I press "Close Account"
And I press "Close Account" in the modal window
Then I should be on the new user session page

When I try to sign in manually
Then I should be on the new user session page
When I wait for the ajax to finish
Then I should see "Invalid email or password."
Then I should see "Your account is locked."

Scenario: user is forced to enter something in the password field on closing account
Given I am signed in
When I click on my name in the header
And I follow "Settings"
And I follow "Close Account"
And I preemptively confirm the alert
And I press "Close Account"
And I press "Close Account" in the modal window
Then I should be on the edit user page
And I should see "Please enter your current password to close your account."

Scenario: user is forced to enter the right password in the password field on closing account
Given I am signed in
When I click on my name in the header
And I follow "Settings"
And I follow "Close Account"
And I preemptively confirm the alert
And I fill in "close_account_password" with "none sense"
And I press "Close Account"
And I fill in "close_account_password" with "none sense" in the modal window
And I press "Close Account" in the modal window
Then I should be on the edit user page
And I should see "The entered password didn't match your current password."

Expand All @@ -50,9 +53,10 @@ Feature: Close Account
Then I sign in as "bob@bob.bob"
When I click on my name in the header
And I follow "Settings"
And I put in my password in "close_account_password"
And I follow "Close Account"
And I put in my password in "close_account_password" in the modal window
And I preemptively confirm the alert
And I press "Close Account"
And I press "Close Account" in the modal window
Then I sign in as "alice@alice.alice"
And I am on the home page
Then I should see "Hi, Bob Jones long time no see"

0 comments on commit 3425939

Please sign in to comment.