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
5f506e6e
Commit
5f506e6e
authored
Mar 27, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `:empty_project` where possible in mailer specs
parent
59828154
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+10
-5
spec/support/notify_shared_examples.rb
spec/support/notify_shared_examples.rb
+1
-1
No files found.
spec/mailers/notify_spec.rb
View file @
5f506e6e
...
...
@@ -184,6 +184,7 @@ describe Notify do
end
context
'for merge requests'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_author
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
)
}
let
(
:merge_request_with_description
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
,
description:
FFaker
::
Lorem
.
sentence
)
}
...
...
@@ -441,7 +442,7 @@ describe Notify do
end
describe
'project was moved'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
,
"gitlab/gitlab"
)
}
...
...
@@ -567,7 +568,7 @@ describe Notify do
end
describe
'project invitation'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:master
)
{
create
(
:user
).
tap
{
|
u
|
project
.
team
<<
[
u
,
:master
]
}
}
let
(
:project_member
)
{
invite_to_project
(
project
,
inviter:
master
)
}
...
...
@@ -587,7 +588,7 @@ describe Notify do
end
describe
'project invitation accepted'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:invited_user
)
{
create
(
:user
,
name:
'invited user'
)
}
let
(
:master
)
{
create
(
:user
).
tap
{
|
u
|
project
.
team
<<
[
u
,
:master
]
}
}
let
(
:project_member
)
do
...
...
@@ -612,7 +613,7 @@ describe Notify do
end
describe
'project invitation declined'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:master
)
{
create
(
:user
).
tap
{
|
u
|
project
.
team
<<
[
u
,
:master
]
}
}
let
(
:project_member
)
do
invitee
=
invite_to_project
(
project
,
inviter:
master
)
...
...
@@ -676,6 +677,7 @@ describe Notify do
end
describe
'on a commit'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:commit
)
{
project
.
commit
}
before
(
:each
)
{
allow
(
note
).
to
receive
(
:noteable
).
and_return
(
commit
)
}
...
...
@@ -743,6 +745,7 @@ describe Notify do
end
context
'items that are noteable, emails for a note on a diff'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
before
:each
do
...
...
@@ -1084,6 +1087,7 @@ describe Notify do
end
describe
'email on push with multiple commits'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:raw_compare
)
{
Gitlab
::
Git
::
Compare
.
new
(
project
.
repository
.
raw_repository
,
sample_image_commit
.
id
,
sample_commit
.
id
)
}
...
...
@@ -1177,6 +1181,7 @@ describe Notify do
end
describe
'email on push with a single commit'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:raw_compare
)
{
Gitlab
::
Git
::
Compare
.
new
(
project
.
repository
.
raw_repository
,
sample_commit
.
parent_id
,
sample_commit
.
id
)
}
...
...
@@ -1235,7 +1240,7 @@ describe Notify do
end
describe
'HTML emails setting'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:multipart_mail
)
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
,
"gitlab/gitlab"
)
}
...
...
spec/support/notify_shared_examples.rb
View file @
5f506e6e
...
...
@@ -3,7 +3,7 @@ shared_context 'gitlab email notification' do
let
(
:gitlab_sender
)
{
Gitlab
.
config
.
gitlab
.
email_from
}
let
(
:gitlab_sender_reply_to
)
{
Gitlab
.
config
.
gitlab
.
email_reply_to
}
let
(
:recipient
)
{
create
(
:user
,
email:
'recipient@example.com'
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
before
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