Commit 131277b0 authored by Marin Jankovski's avatar Marin Jankovski

Add the feature test

parent 4b71ae37
......@@ -9,3 +9,9 @@ Feature: Admin email
When I submit form with email notification info
Then I should see a notification email is begin sent
And admin emails are being sent
Scenario: Create a new email notification
Given I visit unsubscribe from admin notification page
When I click unsubscribe
Then I get redirected to the sign in path
And unsubscribed email is sent
......@@ -29,4 +29,23 @@ class Spinach::Features::AdminEmail < Spinach::FeatureSteps
mail = ActionMailer::Base.deliveries.last
expect(mail.text_part.body.decoded).to include @email_text
end
end
\ No newline at end of file
step 'I visit unsubscribe from admin notification page' do
@user = create(:user)
urlsafe_email = Base64.urlsafe_encode64(@user.email)
visit unsubscribe_path(urlsafe_email)
end
step 'I click unsubscribe' do
click_button 'Unsubscribe'
end
step 'I get redirected to the sign in path' do
current_path.should == root_path
end
step 'unsubscribed email is sent' do
mail = ActionMailer::Base.deliveries.last
expect(mail.text_part.body.decoded).to include "You have been unsubscribed from receiving GitLab administrator notifications."
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment