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
831b0e3d
Commit
831b0e3d
authored
Aug 11, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also test if email is being sent
parent
cd45fd70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
features/admin/emails.feature
features/admin/emails.feature
+1
-0
features/steps/admin/email.rb
features/steps/admin/email.rb
+15
-3
No files found.
features/admin/emails.feature
View file @
831b0e3d
...
...
@@ -8,3 +8,4 @@ Feature: Admin email
Given
I visit admin email page
When
I submit form with email notification info
Then
I should see a notification email is begin send
And
admin emails are being sent
features/steps/admin/email.rb
View file @
831b0e3d
...
...
@@ -4,12 +4,18 @@ class Spinach::Features::AdminEmail < Spinach::FeatureSteps
include
SharedAdmin
step
'I submit form with email notification info'
do
@email_text
=
"I've moved the project"
@selected_project
=
Group
.
last
.
projects
.
first
ActionMailer
::
Base
.
deliveries
=
[]
@email_text
=
"Your project has been moved."
@selected_group
=
Group
.
last
# ensure there are ppl to be emailed
2
.
times
do
@selected_group
.
add_user
(
create
(
:user
),
Gitlab
::
Access
::
DEVELOPER
)
end
within
(
'form#new-admin-email'
)
do
fill_in
:subject
,
with:
'my subject'
fill_in
:body
,
with:
@email_text
select
"
#{
@selected_project
.
group
.
name
}
/
#{
@selected_project
.
name
}
"
,
from: :recipients
select
@selected_group
.
name
,
from: :recipients
find
(
'.btn-create'
).
click
end
end
...
...
@@ -17,4 +23,10 @@ class Spinach::Features::AdminEmail < Spinach::FeatureSteps
step
'I should see a notification email is begin send'
do
expect
(
find
(
'.flash-notice'
)).
to
have_content
'Email send'
end
step
'admin emails are being sent'
do
expect
(
ActionMailer
::
Base
.
deliveries
.
count
).
to
eql
@selected_group
.
users
.
count
mail
=
ActionMailer
::
Base
.
deliveries
.
last
expect
(
mail
.
text_part
.
body
.
decoded
).
to
include
@email_text
end
end
\ No newline at end of file
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