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
9bf6d3ab
Commit
9bf6d3ab
authored
Nov 08, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a list of environments
parent
c3db10d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
25 deletions
+24
-25
spec/features/environments_spec.rb
spec/features/environments_spec.rb
+24
-25
No files found.
spec/features/environments_spec.rb
View file @
9bf6d3ab
require
'spec_helper'
require
'rails_helper'
feature
'Environments'
,
feature:
true
,
js
:true
do
include
WaitForVueResource
given
(
:project
)
{
create
(
:project
)
}
given
(
:user
)
{
create
(
:user
)
}
given
(
:role
)
{
:developer
}
let
(
:json
)
{
serializer
.
as_json
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:role
)
{
:developer
}
let
(
:serializer
)
do
described_class
.
new
(
user:
user
,
project:
project
)
.
represent
(
resource
)
end
background
do
login_as
(
user
)
project
.
team
<<
[
user
,
role
]
end
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
describe
'when showing environments'
do
before
do
...
...
@@ -36,15 +47,15 @@ feature 'Environments', feature: true, js:true do
end
context
'with environments'
do
given!
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let
(
:resource
)
{
create_list
(
:environment
,
2
)
}
scenario
'does show "Available" and "Stopped" tab with links'
do
expect
(
page
).
to
have_link
(
'Stopped'
)
expect
(
page
).
to
have_link
(
'Available'
)
end
scenario
'does show environment
nam
e'
do
expect
(
page
).
to
have_
link
(
environment
.
name
)
scenario
'does show environment
s tabl
e'
do
expect
(
page
).
to
have_
selector
(
'.table-holder'
)
end
scenario
'does show number of available and stopped environments'
do
...
...
@@ -53,20 +64,13 @@ feature 'Environments', feature: true, js:true do
end
context
'without deployments'
do
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
scenario
'does show no deployments'
do
expect
(
page
).
to
have_content
(
'No deployments yet'
)
end
end
context
'with deployments'
do
let!
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
)
}
# TODO add environment with deployment
scenario
'does show deployment SHA'
do
expect
(
page
).
to
have_link
(
deployment
.
short_sha
)
...
...
@@ -142,17 +146,12 @@ feature 'Environments', feature: true, js:true do
end
context
'can create new environment'
do
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
scenario
'does have a New environment button'
do
expect
(
page
).
to
have_link
(
'New environment'
)
end
end
end
describe
'when showing the environment'
do
given
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
given!
(
:deployment
)
{
}
...
...
@@ -246,7 +245,7 @@ feature 'Environments', feature: true, js:true do
end
end
end
describe
'when creating a new environment'
do
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
...
...
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