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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
56aaa397
Commit
56aaa397
authored
Nov 14, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert changes made on rspec tests for environment
parent
09c45429
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
89 deletions
+74
-89
spec/features/environments_spec.rb
spec/features/environments_spec.rb
+74
-89
No files found.
spec/features/environments_spec.rb
View file @
56aaa397
require
'
rails
_helper'
require
'
spec
_helper'
feature
'Environments'
,
feature:
true
,
js
:true
do
feature
'Environments'
,
feature:
true
do
include
WaitForVueResource
given
(
:project
)
{
create
(
:empty_project
)
}
given
(
:user
)
{
create
(
:user
)
}
let
(
:json
)
{
serializer
.
as_json
}
given
(
:role
)
{
:developer
}
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
background
do
login_as
(
user
)
login_as
(
user
)
...
@@ -20,17 +11,22 @@ feature 'Environments', feature: true, js:true do
...
@@ -20,17 +11,22 @@ feature 'Environments', feature: true, js:true do
end
end
describe
'when showing environments'
do
describe
'when showing environments'
do
given!
(
:environment
)
{
}
given!
(
:deployment
)
{
}
given!
(
:manual
)
{
}
before
do
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
end
context
'
without environment
s'
do
context
'
shows two tab
s'
do
scenario
'
does show
"Available" and "Stopped" tab with links'
do
scenario
'
shows
"Available" and "Stopped" tab with links'
do
expect
(
page
).
to
have_link
(
'Available'
)
expect
(
page
).
to
have_link
(
'Available'
)
expect
(
page
).
to
have_link
(
'Stopped'
)
expect
(
page
).
to
have_link
(
'Stopped'
)
end
end
end
context
'without environments'
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
...
@@ -42,19 +38,10 @@ feature 'Environments', feature: true, js:true do
...
@@ -42,19 +38,10 @@ feature 'Environments', feature: true, js:true do
end
end
context
'with environments'
do
context
'with environments'
do
let
(
:resource
)
{
create_list
(
:environment
,
2
)
}
given
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
before
do
endpoint
=
namespace_project_environments_path
(
project
.
namespace
,
project
)
stub_request
(
:any
,
endpoint
).
to_return
(
body:
[{
"name"
:
"test"
}])
end
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
s tabl
e'
do
scenario
'does show environment
nam
e'
do
expect
(
page
).
to
have_
selector
(
'.table-holder'
)
expect
(
page
).
to
have_
link
(
environment
.
name
)
end
end
scenario
'does show number of available and stopped environments'
do
scenario
'does show number of available and stopped environments'
do
...
@@ -69,7 +56,7 @@ feature 'Environments', feature: true, js:true do
...
@@ -69,7 +56,7 @@ feature 'Environments', feature: true, js:true do
end
end
context
'with deployments'
do
context
'with deployments'
do
# 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
)
...
@@ -144,12 +131,10 @@ feature 'Environments', feature: true, js:true do
...
@@ -144,12 +131,10 @@ feature 'Environments', feature: true, js:true do
end
end
end
end
context
'can create new environment'
do
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
describe
'when showing the environment'
do
describe
'when showing the environment'
do
given
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
given
(
:environment
)
{
create
(
:environment
,
project:
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