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
9bed20d2
Commit
9bed20d2
authored
Sep 19, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for warning message shown in Auto DevOps settings
parent
30176977
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
2 deletions
+72
-2
spec/models/project_auto_devops_spec.rb
spec/models/project_auto_devops_spec.rb
+10
-2
spec/views/projects/pipelines_settings/_show.html.haml_spec.rb
...views/projects/pipelines_settings/_show.html.haml_spec.rb
+62
-0
No files found.
spec/models/project_auto_devops_spec.rb
View file @
9bed20d2
...
@@ -9,9 +9,17 @@ describe ProjectAutoDevops do
...
@@ -9,9 +9,17 @@ describe ProjectAutoDevops do
it
{
is_expected
.
to
respond_to
(
:updated_at
)
}
it
{
is_expected
.
to
respond_to
(
:updated_at
)
}
describe
'#has_domain?'
do
describe
'#has_domain?'
do
let
(
:auto_devops
)
{
build_stubbed
(
:project_auto_devops
,
project:
project
,
domain:
'domain.com'
)
}
context
'when domain is defined'
do
let
(
:auto_devops
)
{
build_stubbed
(
:project_auto_devops
,
project:
project
,
domain:
'domain.com'
)
}
it
{
expect
(
auto_devops
).
to
have_domain
}
end
it
{
is_expected
.
to
have_domain
}
context
'when domain is empty'
do
let
(
:auto_devops
)
{
build_stubbed
(
:project_auto_devops
,
project:
project
,
domain:
''
)
}
it
{
expect
(
auto_devops
).
not_to
have_domain
}
end
end
end
describe
'#variables'
do
describe
'#variables'
do
...
...
spec/views/projects/pipelines_settings/_show.html.haml_spec.rb
0 → 100644
View file @
9bed20d2
require
'spec_helper'
describe
'projects/pipelines_settings/_show'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
assign
:project
,
project
end
context
'when kubernetes is not active'
do
context
'when auto devops domain is not defined'
do
it
'shows warning message'
do
render
expect
(
rendered
).
to
have_css
(
'.settings-message'
)
expect
(
rendered
).
to
have_text
(
'Auto Review Apps and Auto Deploy need a domain name and the'
)
expect
(
rendered
).
to
have_link
(
'Kubernetes service'
)
end
end
context
'when auto devops domain is defined'
do
before
do
project
.
build_auto_devops
(
domain:
'example.com'
)
end
it
'shows warning message'
do
render
expect
(
rendered
).
to
have_css
(
'.settings-message'
)
expect
(
rendered
).
to
have_text
(
'Auto Review Apps and Auto Deploy need the'
)
expect
(
rendered
).
to
have_link
(
'Kubernetes service'
)
end
end
end
context
'when kubernetes is active'
do
before
do
project
.
build_kubernetes_service
(
active:
true
)
end
context
'when auto devops domain is not defined'
do
it
'shows warning message'
do
render
expect
(
rendered
).
to
have_css
(
'.settings-message'
)
expect
(
rendered
).
to
have_text
(
'Auto Review Apps and Auto Deploy need a domain name to work correctly.'
)
end
end
context
'when auto devops domain is defined'
do
before
do
project
.
build_auto_devops
(
domain:
'example.com'
)
end
it
'does not show warning message'
do
render
expect
(
rendered
).
not_to
have_css
(
'.settings-message'
)
end
end
end
end
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