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
785094e2
Commit
785094e2
authored
Sep 27, 2016
by
Fu Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create new test in `spec/mailers/notify_spec.rb`
parent
f3f7f3fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+11
-0
spec/mailers/shared/notify.rb
spec/mailers/shared/notify.rb
+0
-4
No files found.
spec/mailers/notify_spec.rb
View file @
785094e2
...
@@ -1094,4 +1094,15 @@ describe Notify do
...
@@ -1094,4 +1094,15 @@ describe Notify do
is_expected
.
to
have_body_text
/
#{
diff_path
}
/
is_expected
.
to
have_body_text
/
#{
diff_path
}
/
end
end
end
end
describe
'email has correct subject'
do
let
(
:gitlab_subject_suffix
)
{
Gitlab
.
config
.
gitlab
.
email_subject_suffix
}
it
'has correct suffix'
do
if
gitlab_subject_suffix
.
length
>
0
is_expected
.
to
have_subject
gitlab_subject_suffix
end
end
end
end
end
spec/mailers/shared/notify.rb
View file @
785094e2
...
@@ -2,7 +2,6 @@ shared_context 'gitlab email notification' do
...
@@ -2,7 +2,6 @@ shared_context 'gitlab email notification' do
let
(
:gitlab_sender_display_name
)
{
Gitlab
.
config
.
gitlab
.
email_display_name
}
let
(
:gitlab_sender_display_name
)
{
Gitlab
.
config
.
gitlab
.
email_display_name
}
let
(
:gitlab_sender
)
{
Gitlab
.
config
.
gitlab
.
email_from
}
let
(
:gitlab_sender
)
{
Gitlab
.
config
.
gitlab
.
email_from
}
let
(
:gitlab_sender_reply_to
)
{
Gitlab
.
config
.
gitlab
.
email_reply_to
}
let
(
:gitlab_sender_reply_to
)
{
Gitlab
.
config
.
gitlab
.
email_reply_to
}
let
(
:gitlab_subject_suffix
)
{
Gitlab
.
config
.
gitlab
.
email_subject_suffix
}
let
(
:recipient
)
{
create
(
:user
,
email:
'recipient@example.com'
)
}
let
(
:recipient
)
{
create
(
:user
,
email:
'recipient@example.com'
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
...
@@ -32,9 +31,6 @@ shared_examples 'an email sent from GitLab' do
...
@@ -32,9 +31,6 @@ shared_examples 'an email sent from GitLab' do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
expect
(
sender
.
display_name
).
to
eq
(
gitlab_sender_display_name
)
expect
(
sender
.
display_name
).
to
eq
(
gitlab_sender_display_name
)
expect
(
sender
.
address
).
to
eq
(
gitlab_sender
)
expect
(
sender
.
address
).
to
eq
(
gitlab_sender
)
if
gitlab_subject_suffix
.
length
>
0
is_expected
.
to
have_subject
gitlab_subject_suffix
end
end
end
it
'has a Reply-To address'
do
it
'has a Reply-To address'
do
...
...
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