diff options
author | Ciro Santillli <ciro.santilli@gmail.com> | 2014-02-23 13:04:56 +0400 |
---|---|---|
committer | Ciro Santillli <ciro.santilli@gmail.com> | 2014-02-23 13:34:39 +0400 |
commit | 170340e6b15f91e79cf683c892ec887c3115b317 (patch) | |
tree | 19cf1f82b08201295b3e66170a967e813c522189 /features/steps/profile/emails.rb | |
parent | e868de687da060a109bd67fd492ed110eb134d47 (diff) |
Remove dir prefix and suffix from tests inside dir.
Diffstat (limited to 'features/steps/profile/emails.rb')
-rw-r--r-- | features/steps/profile/emails.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/features/steps/profile/emails.rb b/features/steps/profile/emails.rb new file mode 100644 index 00000000000..99588c85991 --- /dev/null +++ b/features/steps/profile/emails.rb @@ -0,0 +1,48 @@ +class ProfileEmails < Spinach::FeatureSteps + include SharedAuthentication + + Then 'I visit profile emails page' do + visit profile_emails_path + end + + Then 'I should see my emails' do + page.should have_content(@user.email) + @user.emails.each do |email| + page.should have_content(email.email) + end + end + + And 'I submit new email "my@email.com"' do + fill_in "email_email", with: "my@email.com" + click_button "Add" + end + + Then 'I should see new email "my@email.com"' do + email = @user.emails.find_by(email: "my@email.com") + email.should_not be_nil + page.should have_content("my@email.com") + end + + Then 'I should not see email "my@email.com"' do + email = @user.emails.find_by(email: "my@email.com") + email.should be_nil + page.should_not have_content("my@email.com") + end + + Then 'I click link "Remove" for "my@email.com"' do + # there should only be one remove button at this time + click_link "Remove" + # force these to reload as they have been cached + @user.emails.reload + end + + And 'I submit duplicate email @user.email' do + fill_in "email_email", with: @user.email + click_button "Add" + end + + Then 'I should not have @user.email added' do + email = @user.emails.find_by(email: @user.email) + email.should be_nil + end +end |