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
ffd109af
Commit
ffd109af
authored
Jan 09, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for QA test selectors sanity scenario
parent
7725a707
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
qa/qa/scenario/test/sanity/selectors.rb
qa/qa/scenario/test/sanity/selectors.rb
+2
-2
qa/spec/scenario/test/sanity/selectors_spec.rb
qa/spec/scenario/test/sanity/selectors_spec.rb
+40
-0
No files found.
qa/qa/scenario/test/sanity/selectors.rb
View file @
ffd109af
...
@@ -15,7 +15,7 @@ module QA
...
@@ -15,7 +15,7 @@ module QA
validators
.
map
(
&
:errors
).
flatten
.
tap
do
|
errors
|
validators
.
map
(
&
:errors
).
flatten
.
tap
do
|
errors
|
break
if
errors
.
none?
break
if
errors
.
none?
STDERR
.
puts
<<~
EOS
$stderr
.
puts
<<~
EOS
GitLab QA sanity selectors validation test detected problems
GitLab QA sanity selectors validation test detected problems
with your merge request!
with your merge request!
...
@@ -40,7 +40,7 @@ module QA
...
@@ -40,7 +40,7 @@ module QA
EOS
EOS
STDERR
.
puts
errors
$stderr
.
puts
errors
end
end
validators
.
each
(
&
:validate!
)
validators
.
each
(
&
:validate!
)
...
...
qa/spec/scenario/test/sanity/selectors_spec.rb
0 → 100644
View file @
ffd109af
describe
QA
::
Scenario
::
Test
::
Sanity
::
Selectors
do
let
(
:validator
)
{
spy
(
'validator'
)
}
before
do
stub_const
(
'QA::Page::Validator'
,
validator
)
end
context
'when there are errors detected'
do
before
do
allow
(
validator
).
to
receive
(
:errors
).
and_return
([
'some error'
])
end
it
'outputs information about errors'
do
expect
{
described_class
.
perform
}
.
to
output
(
/some error/
).
to_stderr
expect
{
described_class
.
perform
}
.
to
output
(
/electors validation test detected problems/
)
.
to_stderr
end
end
context
'when there are no errors detected'
do
before
do
allow
(
validator
).
to
receive
(
:errors
).
and_return
([])
end
it
'processes pages module'
do
described_class
.
perform
expect
(
validator
).
to
have_received
(
:new
).
with
(
QA
::
Page
)
end
it
'triggers validation'
do
described_class
.
perform
expect
(
validator
).
to
have_received
(
:validate!
)
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