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
509a4899
Commit
509a4899
authored
Apr 29, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move rails root join in the matcher
parent
e1bd1bbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
ee/spec/controllers/survey_responses_controller_spec.rb
ee/spec/controllers/survey_responses_controller_spec.rb
+1
-1
spec/support/matchers/schema_matcher.rb
spec/support/matchers/schema_matcher.rb
+1
-2
No files found.
ee/spec/controllers/survey_responses_controller_spec.rb
View file @
509a4899
...
...
@@ -29,7 +29,7 @@ RSpec.describe SurveyResponsesController do
context:
[{
schema:
described_class
::
SURVEY_RESPONSE_SCHEMA_URL
,
data:
{
response:
'bar'
,
survey_id:
1
}
}]
)
match_snowplow_context_schema
(
schema_path:
'survey_response_schema'
,
context:
{
:response
=>
'bar'
,
:survey_id
=>
1
,
:instance_id
=>
2
}
)
match_snowplow_context_schema
(
schema_path:
'survey_response_schema'
,
context:
{
response:
'bar'
,
survey_id:
1
,
instance_id:
2
}
)
end
end
...
...
spec/support/matchers/schema_matcher.rb
View file @
509a4899
...
...
@@ -13,7 +13,6 @@ module SchemaPath
end
Rails
.
root
.
join
(
dir
.
to_s
,
'spec'
,
"fixtures/api/schemas/
#{
schema
}
.json"
).
to_s
Rails
.
root
.
join
(
dir
.
to_s
,
'spec'
,
"fixtures/product_intelligence/
#{
schema
}
.json"
).
to_s
end
def
self
.
validator
(
schema_path
)
...
...
@@ -48,7 +47,7 @@ end
RSpec
::
Matchers
.
define
:match_snowplow_schema
do
|
schema
,
dir:
nil
,
**
options
|
match
do
|
data
|
schema_path
=
Pathname
.
new
(
SchemaPath
.
expand
(
schema
,
dir
)
)
schema_path
=
Pathname
.
new
(
Rails
.
root
.
join
(
dir
.
to_s
,
'spec'
,
"fixtures/product_intelligence/
#{
schema
}
.json"
).
to_s
)
validator
=
SchemaPath
.
validator
(
schema_path
)
validator
.
valid?
(
data
.
stringify_keys
)
...
...
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