Add admin notification unsubscribe feature

This commit is contained in:
Marin Jankovski
2014-08-22 10:45:45 +02:00
parent 93e2e302c8
commit b5342de57b
2 changed files with 23 additions and 0 deletions
+16
View File
@@ -7,4 +7,20 @@ class Spinach::Features::User < Spinach::FeatureSteps
step 'I should see user "John Doe" page' do
expect(page.title).to match(/^\s*John Doe/)
end
step 'I visit unsubscribe link' do
visit "/unsubscribes/joh@doe.org"
end
step 'I should see unsubscribe text and button' do
page.should have_content "Unsubscribe from Admin notifications Yes, I want to unsubscribe joh@doe.org from any further admin emails."
end
step 'I press the unsubscribe button' do
click_button("Unsubscribe")
end
step 'I should be unsubscribed' do
current_path.should == root_path
end
end
+7
View File
@@ -67,3 +67,10 @@ Feature: User
And I should see project "Enterprise"
And I should not see project "Internal"
And I should not see project "Community"
Scenario: I unsubscribe from admin notifications
Given I sign in as "John Doe"
When I visit unsubscribe link
Then I should see unsubscribe text and button
And I press the unsubscribe button
Then I should be unsubscribed