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
Jérome Perrin
gitlab-ce
Commits
aff71398
Commit
aff71398
authored
Dec 22, 2015
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve CI Lint specs (refactoring)
parent
25bf3eb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
+29
-18
spec/features/lint_spec.rb
spec/features/lint_spec.rb
+29
-18
No files found.
spec/features/lint_spec.rb
View file @
aff71398
require
'spec_helper'
require
'spec_helper'
describe
"Lint"
do
describe
'CI Lint'
do
before
do
before
do
login_as
:user
login_as
:user
end
end
it
"Yaml parsing"
,
js:
true
do
describe
'YAML parsing'
,
js:
true
do
content
=
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
before
do
visit
ci_lint_path
visit
ci_lint_path
fill_in
"content"
,
with:
content
fill_in
'content'
,
with:
yaml_content
click_on
"Validate"
click_on
'Validate'
within
"table"
do
expect
(
page
).
to
have_content
(
"Job - rspec"
)
expect
(
page
).
to
have_content
(
"Job - spinach"
)
expect
(
page
).
to
have_content
(
"Deploy Job - staging"
)
expect
(
page
).
to
have_content
(
"Deploy Job - production"
)
end
end
end
it
"Yaml parsing with error"
,
js:
true
do
context
'YAML is correct'
do
visit
ci_lint_path
let
(
:yaml_content
)
do
fill_in
"content"
,
with:
""
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
click_on
"Validate"
end
expect
(
page
).
to
have_content
(
"Status: syntax is incorrect"
)
expect
(
page
).
to
have_content
(
"Error: Please provide content of .gitlab-ci.yml"
)
it
'Yaml parsing'
do
within
"table"
do
expect
(
page
).
to
have_content
(
'Job - rspec'
)
expect
(
page
).
to
have_content
(
'Job - spinach'
)
expect
(
page
).
to
have_content
(
'Deploy Job - staging'
)
expect
(
page
).
to
have_content
(
'Deploy Job - production'
)
end
end
end
context
'YAML is incorrect'
do
let
(
:yaml_content
)
{
''
}
it
'displays information about an error'
do
expect
(
page
).
to
have_content
(
'Status: syntax is incorrect'
)
expect
(
page
).
to
have_content
(
'Error: Please provide content of .gitlab-ci.yml'
)
end
end
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