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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
42806167
Commit
42806167
authored
Nov 18, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for key/deploy key notifications
parent
a41ee7eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
spec/models/deploy_key_spec.rb
spec/models/deploy_key_spec.rb
+12
-0
spec/models/key_spec.rb
spec/models/key_spec.rb
+12
-0
No files found.
spec/models/deploy_key_spec.rb
View file @
42806167
...
@@ -5,4 +5,16 @@ describe DeployKey, models: true do
...
@@ -5,4 +5,16 @@ describe DeployKey, models: true do
it
{
is_expected
.
to
have_many
(
:deploy_keys_projects
)
}
it
{
is_expected
.
to
have_many
(
:deploy_keys_projects
)
}
it
{
is_expected
.
to
have_many
(
:projects
)
}
it
{
is_expected
.
to
have_many
(
:projects
)
}
end
end
describe
'notification'
do
let
(
:user
)
{
create
(
:user
)
}
it
'does not send a notification'
do
perform_enqueued_jobs
do
create
(
:deploy_key
,
user:
user
)
end
should_not_email
(
user
)
end
end
end
end
spec/models/key_spec.rb
View file @
42806167
...
@@ -92,4 +92,16 @@ describe Key, models: true do
...
@@ -92,4 +92,16 @@ describe Key, models: true do
expect
(
described_class
.
new
(
key:
"
#{
valid_key
}
"
).
key
).
to
eq
(
valid_key
)
expect
(
described_class
.
new
(
key:
"
#{
valid_key
}
"
).
key
).
to
eq
(
valid_key
)
end
end
end
end
describe
'notification'
do
let
(
:user
)
{
create
(
:user
)
}
it
'sends a notification'
do
perform_enqueued_jobs
do
create
(
:key
,
user:
user
)
end
should_email
(
user
)
end
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