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'
require
'rails_helper'
feature
'Environments'
,
feature:
true
,
js
:true
do
feature
'Environments'
,
feature:
true
,
js
:true
do
include
WaitForVueResource
include
WaitForVueResource
given
(
:project
)
{
create
(
:project
)
}
let
(
:json
)
{
serializer
.
as_json
}
given
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
given
(
:role
)
{
:developer
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:role
)
{
:developer
}
let
(
:serializer
)
do
described_class
.
new
(
user:
user
,
project:
project
)
.
represent
(
resource
)
end
background
do
background
do
login_as
(
user
)
login_as
(
user
)
project
.
team
<<
[
user
,
role
]
project
.
team
<<
[
user
,
role
]
end
end
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
describe
'when showing environments'
do
describe
'when showing environments'
do
before
do
before
do
...
@@ -36,15 +47,15 @@ feature 'Environments', feature: true, js:true do
...
@@ -36,15 +47,15 @@ feature 'Environments', feature: true, js:true do
end
end
context
'with environments'
do
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
scenario
'does show "Available" and "Stopped" tab with links'
do
expect
(
page
).
to
have_link
(
'Stopped'
)
expect
(
page
).
to
have_link
(
'Stopped'
)
expect
(
page
).
to
have_link
(
'Available'
)
expect
(
page
).
to
have_link
(
'Available'
)
end
end
scenario
'does show environment
nam
e'
do
scenario
'does show environment
s tabl
e'
do
expect
(
page
).
to
have_
link
(
environment
.
name
)
expect
(
page
).
to
have_
selector
(
'.table-holder'
)
end
end
scenario
'does show number of available and stopped environments'
do
scenario
'does show number of available and stopped environments'
do
...
@@ -53,20 +64,13 @@ feature 'Environments', feature: true, js:true do
...
@@ -53,20 +64,13 @@ feature 'Environments', feature: true, js:true do
end
end
context
'without deployments'
do
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
scenario
'does show no deployments'
do
expect
(
page
).
to
have_content
(
'No deployments yet'
)
expect
(
page
).
to
have_content
(
'No deployments yet'
)
end
end
end
end
context
'with deployments'
do
context
'with deployments'
do
let!
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
# TODO add environment with deployment
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
)
}
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
)
...
@@ -142,17 +146,12 @@ feature 'Environments', feature: true, js:true do
...
@@ -142,17 +146,12 @@ feature 'Environments', feature: true, js:true do
end
end
context
'can create new environment'
do
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
scenario
'does have a New environment button'
do
expect
(
page
).
to
have_link
(
'New environment'
)
expect
(
page
).
to
have_link
(
'New environment'
)
end
end
end
end
end
end
describe
'when showing the environment'
do
describe
'when showing the environment'
do
given
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
given
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
given!
(
:deployment
)
{
}
given!
(
:deployment
)
{
}
...
@@ -246,7 +245,7 @@ feature 'Environments', feature: true, js:true do
...
@@ -246,7 +245,7 @@ feature 'Environments', feature: true, js:true do
end
end
end
end
end
end
describe
'when creating a new environment'
do
describe
'when creating a new environment'
do
before
do
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
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