Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
131277b0
Commit
131277b0
authored
Aug 26, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the feature test
parent
4b71ae37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
features/admin/emails.feature
features/admin/emails.feature
+6
-0
features/steps/admin/email.rb
features/steps/admin/email.rb
+20
-1
No files found.
features/admin/emails.feature
View file @
131277b0
...
...
@@ -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
features/steps/admin/email.rb
View file @
131277b0
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment