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
93e2e302
Commit
93e2e302
authored
Aug 22, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add admin notification spec.
parent
6ea702db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+26
-0
No files found.
spec/mailers/notify_spec.rb
View file @
93e2e302
...
...
@@ -622,4 +622,30 @@ describe Notify do
should
have_body_text
/
#{
diff_path
}
/
end
end
describe
'admin notification'
do
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
@email
=
Notify
.
send_admin_notification
(
user
.
id
,
'Admin announcement'
,
'Text'
)
}
it
'is sent as the author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
sender
.
display_name
.
should
eq
(
"GitLab"
)
sender
.
address
.
should
eq
(
gitlab_sender
)
end
it
'is sent to recipient'
do
should
deliver_to
user
.
email
end
it
'has the correct subject'
do
should
have_subject
'Admin announcement'
end
it
'includes unsubscribe link'
do
unsubscribe_link
=
"http://localhost/unsubscribes/
#{
CGI
.
escape
(
user
.
email
)
}
"
should
have_body_text
(
unsubscribe_link
)
end
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