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
Léo-Paul Géneau
gitlab-ce
Commits
170c07ef
Commit
170c07ef
authored
Jan 09, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix QA pages validation delegation and memoization
parent
fa07d232
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
qa/qa/page/base.rb
qa/qa/page/base.rb
+1
-1
qa/qa/page/validator.rb
qa/qa/page/validator.rb
+4
-6
qa/qa/scenario/test/sanity/selectors.rb
qa/qa/scenario/test/sanity/selectors.rb
+0
-1
No files found.
qa/qa/page/base.rb
View file @
170c07ef
...
@@ -53,7 +53,7 @@ module QA
...
@@ -53,7 +53,7 @@ module QA
return
[
"
#{
name
}
class does not have views / elements defined!"
]
return
[
"
#{
name
}
class does not have views / elements defined!"
]
end
end
@errors
||=
views
.
map
(
&
:errors
).
flatten
views
.
map
(
&
:errors
).
flatten
end
end
class
DSL
class
DSL
...
...
qa/qa/page/validator.rb
View file @
170c07ef
...
@@ -2,7 +2,7 @@ module QA
...
@@ -2,7 +2,7 @@ module QA
module
Page
module
Page
class
Validator
class
Validator
ValidationError
=
Class
.
new
(
StandardError
)
ValidationError
=
Class
.
new
(
StandardError
)
Error
=
Struct
.
new
(
:page
,
:
view
,
:
message
)
Error
=
Struct
.
new
(
:page
,
:message
)
def
initialize
(
constant
)
def
initialize
(
constant
)
@module
=
constant
@module
=
constant
...
@@ -28,12 +28,10 @@ module QA
...
@@ -28,12 +28,10 @@ module QA
end
end
def
errors
def
errors
@errors
||=
Array
.
new
.
tap
do
|
errors
|
Array
.
new
.
tap
do
|
errors
|
descendants
.
each
do
|
page
|
descendants
.
each
do
|
page
|
page
.
views
.
each
do
|
view
|
page
.
errors
.
each
do
|
message
|
view
.
errors
.
each
do
|
message
|
errors
.
push
(
Error
.
new
(
page
.
name
,
message
))
errors
.
push
(
Error
.
new
(
page
.
name
,
view
.
path
,
message
))
end
end
end
end
end
end
end
...
...
qa/qa/scenario/test/sanity/selectors.rb
View file @
170c07ef
...
@@ -13,7 +13,6 @@ module QA
...
@@ -13,7 +13,6 @@ module QA
end
end
validators
.
map
(
&
:errors
).
flatten
.
tap
do
|
errors
|
validators
.
map
(
&
:errors
).
flatten
.
tap
do
|
errors
|
end
end
validators
.
each
(
&
:validate!
)
validators
.
each
(
&
:validate!
)
...
...
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