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
Boxiang Sun
gitlab-ce
Commits
e81ea165
Commit
e81ea165
authored
May 03, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added worker spec
parent
7ac89d05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
spec/workers/propagate_project_service_worker_spec.rb
spec/workers/propagate_project_service_worker_spec.rb
+36
-0
No files found.
spec/workers/propagate_project_service_worker_spec.rb
0 → 100644
View file @
e81ea165
require
'spec_helper'
describe
PruneOldEventsWorker
do
describe
'#perform'
do
let!
(
:service_template
)
do
PushoverService
.
create
(
template:
true
,
properties:
{
device:
'MyDevice'
,
sound:
'mic'
,
priority:
4
,
api_key:
'123456789'
})
end
let!
(
:project
)
{
create
(
:empty_project
)
}
it
'creates services for projects'
do
expect
{
subject
.
perform
}.
to
change
{
Service
.
count
}.
by
(
1
)
end
it
'does not create the service if it exists already'
do
Service
.
build_from_template
(
project
.
id
,
service_template
).
save!
expect
{
subject
.
perform
}.
not_to
change
{
Service
.
count
}
end
it
'creates the service containing the template attributes'
do
subject
.
perform
service
=
Service
.
find_by
(
service_template
.
merge
(
project_id:
project
.
id
,
template:
false
))
expect
(
service
).
not_to
be_nil
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