Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
ca738d5f63ef
Commit
d375e3f1
authored
Nov 21, 2016
by
Kamil Trzcinski
Browse files
Fix specs and improve code readability
parent
0b78aa4e5f2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/mattermost/presenter.rb
View file @
ca738d5f
...
...
@@ -30,9 +30,9 @@ def present(subject)
if
subject
.
is_a?
(
Gitlab
::
ChatCommands
::
Result
)
show_result
(
subject
)
elsif
subject
.
respond_to?
(
:count
)
if
subject
.
try
(
:
many?
)
if
subject
.
many?
multiple_resources
(
subject
)
elsif
subject
.
count
==
0
elsif
subject
.
none?
not_found
else
single_resource
(
subject
)
...
...
spec/lib/gitlab/chat_commands/deploy_spec.rb
View file @
ca738d5f
...
...
@@ -52,12 +52,13 @@
context
'when teardown action exists'
do
let!
(
:teardown
)
do
create
(
:ci_build
,
:manual
,
:teardown_environment
,
project:
project
,
pipeline:
build
.
pipeline
,
create
(
:ci_build
,
:manual
,
:teardown_environment
,
project:
project
,
pipeline:
build
.
pipeline
,
name:
'teardown'
,
environment:
'production'
)
end
it
'returns error'
do
expect
(
subject
).
to
eq
(
action
)
expect
(
subject
).
to
eq
(
manual1
)
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