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
f647ad8f
Commit
f647ad8f
authored
Apr 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix chatops specs with incorrectly defined project
parent
5b6202cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
command_spec.rb
spec/lib/gitlab/chat_commands/command_spec.rb
+10
-4
deploy_spec.rb
spec/lib/gitlab/chat_commands/deploy_spec.rb
+10
-6
No files found.
spec/lib/gitlab/chat_commands/command_spec.rb
View file @
f647ad8f
...
@@ -40,11 +40,15 @@ describe Gitlab::ChatCommands::Command, service: true do
...
@@ -40,11 +40,15 @@ describe Gitlab::ChatCommands::Command, service: true do
context
'when trying to do deployment'
do
context
'when trying to do deployment'
do
let
(
:params
)
{
{
text:
'deploy staging to production'
}
}
let
(
:params
)
{
{
text:
'deploy staging to production'
}
}
let!
(
:build
)
{
create
(
:ci_build
,
project:
project
)
}
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:staging
)
{
create
(
:environment
,
name:
'staging'
,
project:
project
)
}
let!
(
:staging
)
{
create
(
:environment
,
name:
'staging'
,
project:
project
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
staging
,
deployable:
build
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
staging
,
deployable:
build
)
}
let!
(
:manual
)
do
let!
(
:manual
)
do
create
(
:ci_build
,
:manual
,
project:
project
,
pipeline:
build
.
pipeline
,
name:
'first'
,
environment:
'production'
)
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'first'
,
environment:
'production'
)
end
end
context
'and user can not create deployment'
do
context
'and user can not create deployment'
do
...
@@ -56,7 +60,7 @@ describe Gitlab::ChatCommands::Command, service: true do
...
@@ -56,7 +60,7 @@ describe Gitlab::ChatCommands::Command, service: true do
context
'and user does have deployment permission'
do
context
'and user does have deployment permission'
do
before
do
before
do
project
.
team
<<
[
user
,
:developer
]
build
.
project
.
add_master
(
user
)
end
end
it
'returns action'
do
it
'returns action'
do
...
@@ -66,7 +70,9 @@ describe Gitlab::ChatCommands::Command, service: true do
...
@@ -66,7 +70,9 @@ describe Gitlab::ChatCommands::Command, service: true do
context
'when duplicate action exists'
do
context
'when duplicate action exists'
do
let!
(
:manual2
)
do
let!
(
:manual2
)
do
create
(
:ci_build
,
:manual
,
project:
project
,
pipeline:
build
.
pipeline
,
name:
'second'
,
environment:
'production'
)
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'second'
,
environment:
'production'
)
end
end
it
'returns error'
do
it
'returns error'
do
...
...
spec/lib/gitlab/chat_commands/deploy_spec.rb
View file @
f647ad8f
...
@@ -7,7 +7,7 @@ describe Gitlab::ChatCommands::Deploy, service: true do
...
@@ -7,7 +7,7 @@ describe Gitlab::ChatCommands::Deploy, service: true do
let
(
:regex_match
)
{
described_class
.
match
(
'deploy staging to production'
)
}
let
(
:regex_match
)
{
described_class
.
match
(
'deploy staging to production'
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
add_master
(
user
)
end
end
subject
do
subject
do
...
@@ -23,7 +23,8 @@ describe Gitlab::ChatCommands::Deploy, service: true do
...
@@ -23,7 +23,8 @@ describe Gitlab::ChatCommands::Deploy, service: true do
context
'with environment'
do
context
'with environment'
do
let!
(
:staging
)
{
create
(
:environment
,
name:
'staging'
,
project:
project
)
}
let!
(
:staging
)
{
create
(
:environment
,
name:
'staging'
,
project:
project
)
}
let!
(
:build
)
{
create
(
:ci_build
,
project:
project
)
}
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
staging
,
deployable:
build
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
staging
,
deployable:
build
)
}
context
'without actions'
do
context
'without actions'
do
...
@@ -35,7 +36,9 @@ describe Gitlab::ChatCommands::Deploy, service: true do
...
@@ -35,7 +36,9 @@ describe Gitlab::ChatCommands::Deploy, service: true do
context
'with action'
do
context
'with action'
do
let!
(
:manual1
)
do
let!
(
:manual1
)
do
create
(
:ci_build
,
:manual
,
project:
project
,
pipeline:
build
.
pipeline
,
name:
'first'
,
environment:
'production'
)
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'first'
,
environment:
'production'
)
end
end
it
'returns success result'
do
it
'returns success result'
do
...
@@ -45,7 +48,9 @@ describe Gitlab::ChatCommands::Deploy, service: true do
...
@@ -45,7 +48,9 @@ describe Gitlab::ChatCommands::Deploy, service: true do
context
'when duplicate action exists'
do
context
'when duplicate action exists'
do
let!
(
:manual2
)
do
let!
(
:manual2
)
do
create
(
:ci_build
,
:manual
,
project:
project
,
pipeline:
build
.
pipeline
,
name:
'second'
,
environment:
'production'
)
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'second'
,
environment:
'production'
)
end
end
it
'returns error'
do
it
'returns error'
do
...
@@ -57,8 +62,7 @@ describe Gitlab::ChatCommands::Deploy, service: true do
...
@@ -57,8 +62,7 @@ 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
,
create
(
:ci_build
,
:manual
,
:teardown_environment
,
project:
project
,
pipeline:
build
.
pipeline
,
pipeline:
pipeline
,
name:
'teardown'
,
environment:
'production'
)
name:
'teardown'
,
environment:
'production'
)
end
end
it
'returns the success message'
do
it
'returns the success message'
do
...
...
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