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
d375e3f1
Commit
d375e3f1
authored
Nov 21, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs and improve code readability
parent
a36d5561
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/mattermost/presenter.rb
lib/mattermost/presenter.rb
+2
-2
spec/lib/gitlab/chat_commands/deploy_spec.rb
spec/lib/gitlab/chat_commands/deploy_spec.rb
+3
-2
No files found.
lib/mattermost/presenter.rb
View file @
d375e3f1
...
@@ -30,9 +30,9 @@ module Mattermost
...
@@ -30,9 +30,9 @@ module Mattermost
if
subject
.
is_a?
(
Gitlab
::
ChatCommands
::
Result
)
if
subject
.
is_a?
(
Gitlab
::
ChatCommands
::
Result
)
show_result
(
subject
)
show_result
(
subject
)
elsif
subject
.
respond_to?
(
:count
)
elsif
subject
.
respond_to?
(
:count
)
if
subject
.
try
(
:many?
)
if
subject
.
many?
multiple_resources
(
subject
)
multiple_resources
(
subject
)
elsif
subject
.
count
==
0
elsif
subject
.
none?
not_found
not_found
else
else
single_resource
(
subject
)
single_resource
(
subject
)
...
...
spec/lib/gitlab/chat_commands/deploy_spec.rb
View file @
d375e3f1
...
@@ -52,12 +52,13 @@ describe Gitlab::ChatCommands::Deploy, service: true do
...
@@ -52,12 +52,13 @@ describe Gitlab::ChatCommands::Deploy, service: true do
context
'when teardown action exists'
do
context
'when teardown action exists'
do
let!
(
:teardown
)
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'
)
name:
'teardown'
,
environment:
'production'
)
end
end
it
'returns error'
do
it
'returns error'
do
expect
(
subject
).
to
eq
(
action
)
expect
(
subject
).
to
eq
(
manual1
)
end
end
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