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
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
include
WaitForVueResource
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
feature
'Environments'
,
feature:
true
do
given
(
:project
)
{
create
(
:empty_project
)
}
given
(
:user
)
{
create
(
:user
)
}
given
(
:role
)
{
:developer
}
background
do
login_as
(
user
)
...
...
@@ -20,17 +11,22 @@ feature 'Environments', feature: true, js:true do
end
describe
'when showing environments'
do
given!
(
:environment
)
{
}
given!
(
:deployment
)
{
}
given!
(
:manual
)
{
}
before
do
visit
namespace_project_environments_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
context
'
without environment
s'
do
scenario
'
does show
"Available" and "Stopped" tab with links'
do
context
'
shows two tab
s'
do
scenario
'
shows
"Available" and "Stopped" tab with links'
do
expect
(
page
).
to
have_link
(
'Available'
)
expect
(
page
).
to
have_link
(
'Stopped'
)
end
end
context
'without environments'
do
scenario
'does show no environments'
do
expect
(
page
).
to
have_content
(
'You don\'t have any environments right now.'
)
end
...
...
@@ -42,19 +38,10 @@ feature 'Environments', feature: true, js:true do
end
context
'with environments'
do
let
(
:resource
)
{
create_list
(
:environment
,
2
)
}
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
given
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
scenario
'does show environment
s tabl
e'
do
expect
(
page
).
to
have_
selector
(
'.table-holder'
)
scenario
'does show environment
nam
e'
do
expect
(
page
).
to
have_
link
(
environment
.
name
)
end
scenario
'does show number of available and stopped environments'
do
...
...
@@ -69,7 +56,7 @@ feature 'Environments', feature: true, js:true do
end
context
'with deployments'
do
# TODO add environment with deployment
given
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
)
}
scenario
'does show deployment SHA'
do
expect
(
page
).
to
have_link
(
deployment
.
short_sha
)
...
...
@@ -144,12 +131,10 @@ feature 'Environments', feature: true, js:true do
end
end
context
'can create new environment'
do
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
)
}
...
...
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