BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
60288d6c
Commit
60288d6c
authored
Feb 15, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use expect { }.to change { }
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8664#note_23427575
parent
3856a3da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
runners_controller_spec.rb
spec/controllers/admin/runners_controller_spec.rb
+9
-9
runners_controller_spec.rb
spec/controllers/projects/runners_controller_spec.rb
+9
-9
No files found.
spec/controllers/admin/runners_controller_spec.rb
View file @
60288d6c
...
...
@@ -31,16 +31,16 @@ describe Admin::RunnersController do
describe
'#update'
do
it
'updates the runner and ticks the queue'
do
old_tick
=
runner
.
ensure_runner_queue_value
new_desc
=
runner
.
description
.
swapcase
post
:update
,
id:
runner
.
id
,
runner:
{
description:
new_desc
}
expect
do
post
:update
,
id:
runner
.
id
,
runner:
{
description:
new_desc
}
end
.
to
change
{
runner
.
ensure_runner_queue_value
}
runner
.
reload
expect
(
response
).
to
have_http_status
(
302
)
expect
(
runner
.
description
).
to
eq
(
new_desc
)
expect
(
runner
.
ensure_runner_queue_value
).
not_to
eq
(
old_tick
)
end
end
...
...
@@ -55,31 +55,31 @@ describe Admin::RunnersController do
describe
'#resume'
do
it
'marks the runner as active and ticks the queue'
do
old_tick
=
runner
.
ensure_runner_queue_value
runner
.
update
(
active:
false
)
post
:resume
,
id:
runner
.
id
expect
do
post
:resume
,
id:
runner
.
id
end
.
to
change
{
runner
.
ensure_runner_queue_value
}
runner
.
reload
expect
(
response
).
to
have_http_status
(
302
)
expect
(
runner
.
active
).
to
eq
(
true
)
expect
(
runner
.
ensure_runner_queue_value
).
not_to
eq
(
old_tick
)
end
end
describe
'#pause'
do
it
'marks the runner as inactive and ticks the queue'
do
old_tick
=
runner
.
ensure_runner_queue_value
runner
.
update
(
active:
true
)
post
:pause
,
id:
runner
.
id
expect
do
post
:pause
,
id:
runner
.
id
end
.
to
change
{
runner
.
ensure_runner_queue_value
}
runner
.
reload
expect
(
response
).
to
have_http_status
(
302
)
expect
(
runner
.
active
).
to
eq
(
false
)
expect
(
runner
.
ensure_runner_queue_value
).
not_to
eq
(
old_tick
)
end
end
end
spec/controllers/projects/runners_controller_spec.rb
View file @
60288d6c
...
...
@@ -21,16 +21,16 @@ describe Projects::RunnersController do
describe
'#update'
do
it
'updates the runner and ticks the queue'
do
old_tick
=
runner
.
ensure_runner_queue_value
new_desc
=
runner
.
description
.
swapcase
post
:update
,
params
.
merge
(
runner:
{
description:
new_desc
}
)
expect
do
post
:update
,
params
.
merge
(
runner:
{
description:
new_desc
}
)
end
.
to
change
{
runner
.
ensure_runner_queue_value
}
runner
.
reload
expect
(
response
).
to
have_http_status
(
302
)
expect
(
runner
.
description
).
to
eq
(
new_desc
)
expect
(
runner
.
ensure_runner_queue_value
).
not_to
eq
(
old_tick
)
end
end
...
...
@@ -45,31 +45,31 @@ describe Projects::RunnersController do
describe
'#resume'
do
it
'marks the runner as active and ticks the queue'
do
old_tick
=
runner
.
ensure_runner_queue_value
runner
.
update
(
active:
false
)
post
:resume
,
params
expect
do
post
:resume
,
params
end
.
to
change
{
runner
.
ensure_runner_queue_value
}
runner
.
reload
expect
(
response
).
to
have_http_status
(
302
)
expect
(
runner
.
active
).
to
eq
(
true
)
expect
(
runner
.
ensure_runner_queue_value
).
not_to
eq
(
old_tick
)
end
end
describe
'#pause'
do
it
'marks the runner as inactive and ticks the queue'
do
old_tick
=
runner
.
ensure_runner_queue_value
runner
.
update
(
active:
true
)
post
:pause
,
params
expect
do
post
:pause
,
params
end
.
to
change
{
runner
.
ensure_runner_queue_value
}
runner
.
reload
expect
(
response
).
to
have_http_status
(
302
)
expect
(
runner
.
active
).
to
eq
(
false
)
expect
(
runner
.
ensure_runner_queue_value
).
not_to
eq
(
old_tick
)
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