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
bebfceb1
Commit
bebfceb1
authored
Oct 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
5a46e22a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
spec/features/environments_spec.rb
spec/features/environments_spec.rb
+9
-9
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+1
-1
spec/lib/gitlab/ci/config/node/environment_spec.rb
spec/lib/gitlab/ci/config/node/environment_spec.rb
+1
-1
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+1
-1
No files found.
spec/features/environments_spec.rb
View file @
bebfceb1
...
@@ -18,7 +18,7 @@ feature 'Environments', feature: true do
...
@@ -18,7 +18,7 @@ feature 'Environments', feature: true do
before
do
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
end
end
context
'shows two tabs'
do
context
'shows two tabs'
do
scenario
'does show Available tab with link'
do
scenario
'does show Available tab with link'
do
expect
(
page
).
to
have_link
(
'Available'
)
expect
(
page
).
to
have_link
(
'Available'
)
...
@@ -33,7 +33,7 @@ feature 'Environments', feature: true do
...
@@ -33,7 +33,7 @@ feature 'Environments', feature: true do
scenario
'does show no environments'
do
scenario
'does show no environments'
do
expect
(
page
).
to
have_content
(
'You don\'t have any environments right now.'
)
expect
(
page
).
to
have_content
(
'You don\'t have any environments right now.'
)
end
end
scenario
'does show 0 as counter for environments in both tabs'
do
scenario
'does show 0 as counter for environments in both tabs'
do
expect
(
page
.
find
(
'.js-available-environments-count'
).
text
).
to
eq
(
'0'
)
expect
(
page
.
find
(
'.js-available-environments-count'
).
text
).
to
eq
(
'0'
)
expect
(
page
.
find
(
'.js-stopped-environments-count'
).
text
).
to
eq
(
'0'
)
expect
(
page
.
find
(
'.js-stopped-environments-count'
).
text
).
to
eq
(
'0'
)
...
@@ -46,7 +46,7 @@ feature 'Environments', feature: true do
...
@@ -46,7 +46,7 @@ feature 'Environments', feature: true do
scenario
'does show environment name'
do
scenario
'does show environment name'
do
expect
(
page
).
to
have_link
(
environment
.
name
)
expect
(
page
).
to
have_link
(
environment
.
name
)
end
end
scenario
'does show number of opened environments in Available tab'
do
scenario
'does show number of opened environments in Available tab'
do
expect
(
page
.
find
(
'.js-available-environments-count'
).
text
).
to
eq
(
'1'
)
expect
(
page
.
find
(
'.js-available-environments-count'
).
text
).
to
eq
(
'1'
)
end
end
...
@@ -67,7 +67,7 @@ feature 'Environments', feature: true do
...
@@ -67,7 +67,7 @@ feature 'Environments', feature: true do
scenario
'does show deployment SHA'
do
scenario
'does show deployment SHA'
do
expect
(
page
).
to
have_link
(
deployment
.
short_sha
)
expect
(
page
).
to
have_link
(
deployment
.
short_sha
)
end
end
scenario
'does show deployment internal id'
do
scenario
'does show deployment internal id'
do
expect
(
page
).
to
have_content
(
deployment
.
iid
)
expect
(
page
).
to
have_content
(
deployment
.
iid
)
end
end
...
@@ -88,7 +88,7 @@ feature 'Environments', feature: true do
...
@@ -88,7 +88,7 @@ feature 'Environments', feature: true do
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
manual
.
reload
).
to
be_pending
expect
(
manual
.
reload
).
to
be_pending
end
end
scenario
'does show build name and id'
do
scenario
'does show build name and id'
do
expect
(
page
).
to
have_link
(
"
#{
build
.
name
}
(#
#{
build
.
id
}
)"
)
expect
(
page
).
to
have_link
(
"
#{
build
.
name
}
(#
#{
build
.
id
}
)"
)
end
end
...
@@ -100,12 +100,12 @@ feature 'Environments', feature: true do
...
@@ -100,12 +100,12 @@ feature 'Environments', feature: true do
scenario
'does not show external link button'
do
scenario
'does not show external link button'
do
expect
(
page
).
not_to
have_css
(
'external-url'
)
expect
(
page
).
not_to
have_css
(
'external-url'
)
end
end
context
'with external_url'
do
context
'with external_url'
do
given
(
:environment
)
{
create
(
:environment
,
project:
project
,
external_url:
'https://git.gitlab.com'
)
}
given
(
:environment
)
{
create
(
:environment
,
project:
project
,
external_url:
'https://git.gitlab.com'
)
}
given
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
given
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
deployable:
build
)
}
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
deployable:
build
)
}
scenario
'does show an external link button'
do
scenario
'does show an external link button'
do
expect
(
page
).
to
have_link
(
nil
,
href:
environment
.
external_url
)
expect
(
page
).
to
have_link
(
nil
,
href:
environment
.
external_url
)
end
end
...
@@ -198,7 +198,7 @@ feature 'Environments', feature: true do
...
@@ -198,7 +198,7 @@ feature 'Environments', feature: true do
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
page
).
to
have_content
(
manual
.
name
)
expect
(
manual
.
reload
).
to
be_pending
expect
(
manual
.
reload
).
to
be_pending
end
end
context
'with external_url'
do
context
'with external_url'
do
given
(
:environment
)
{
create
(
:environment
,
project:
project
,
external_url:
'https://git.gitlab.com'
)
}
given
(
:environment
)
{
create
(
:environment
,
project:
project
,
external_url:
'https://git.gitlab.com'
)
}
given
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
given
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
...
@@ -217,7 +217,7 @@ feature 'Environments', feature: true do
...
@@ -217,7 +217,7 @@ feature 'Environments', feature: true do
expect
(
page
).
to
have_link
(
'Stop'
)
expect
(
page
).
to
have_link
(
'Stop'
)
end
end
scenario
'
scenario '
does
allow
to
stop
environment
' do
'
do
scenario
'
does allow to stop environment
'
do
click_link
(
'Stop'
)
click_link
(
'Stop'
)
expect
(
page
).
to
have_content
(
'close_app'
)
expect
(
page
).
to
have_content
(
'close_app'
)
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
bebfceb1
...
@@ -754,7 +754,7 @@ module Ci
...
@@ -754,7 +754,7 @@ module Ci
it
'does return production'
do
it
'does return production'
do
expect
(
builds
.
size
).
to
eq
(
1
)
expect
(
builds
.
size
).
to
eq
(
1
)
expect
(
builds
.
first
[
:environment
]).
to
eq
(
environment
)
expect
(
builds
.
first
[
:environment
]).
to
eq
(
environment
)
expect
(
builds
.
first
[
:options
]).
to
include
(
environment:
{
name:
environment
})
expect
(
builds
.
first
[
:options
]).
to
include
(
environment:
{
name:
environment
,
action:
"start"
})
end
end
end
end
...
...
spec/lib/gitlab/ci/config/node/environment_spec.rb
View file @
bebfceb1
...
@@ -28,7 +28,7 @@ describe Gitlab::Ci::Config::Node::Environment do
...
@@ -28,7 +28,7 @@ describe Gitlab::Ci::Config::Node::Environment do
describe
'#value'
do
describe
'#value'
do
it
'returns valid hash'
do
it
'returns valid hash'
do
expect
(
entry
.
value
).
to
eq
(
name:
'production'
)
expect
(
entry
.
value
).
to
include
(
name:
'production'
)
end
end
end
end
...
...
spec/models/environment_spec.rb
View file @
bebfceb1
...
@@ -8,7 +8,7 @@ describe Environment, models: true do
...
@@ -8,7 +8,7 @@ describe Environment, models: true do
it
{
is_expected
.
to
delegate_method
(
:last_deployment
).
to
(
:deployments
).
as
(
:last
)
}
it
{
is_expected
.
to
delegate_method
(
:last_deployment
).
to
(
:deployments
).
as
(
:last
)
}
it
{
is_expected
.
to
delegate_method
(
:stop_action
).
to
(
:last_deployment
)
.
as
(
:last
)
}
it
{
is_expected
.
to
delegate_method
(
:stop_action
).
to
(
:last_deployment
)
}
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:name
).
scoped_to
(
:project_id
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:name
).
scoped_to
(
:project_id
)
}
...
...
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