Commit d3340799 authored by Rajendra Kadam's avatar Rajendra Kadam

Add docs for new snowplow matcher

parent a9c50433
......@@ -895,6 +895,21 @@ When you want to ensure that no event got called, you can use `expect_no_snowplo
end
```
#### Test Snowplow context with the schema
We added a [snowplow schema matcher](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60480)
which accepts `schema path` and the `context`.
We performed following steps to add a schema matcher spec:
1. After adding a new schema in [Iglu repository](https://gitlab.com/gitlab-org/iglu),
copy the same schema to `spec/fixtures/product_intelligence/` directory.
1. From the schema, remove `"$schema"` key and value. We do not need it for specs
and spec fails if we keep the key as it tries to look for the schema in the URL.
1. Use the following snippet to call the matcher:
```rb
match_snowplow_context_schema(schema_path: '<filename from step 1>', context: <Context Hash> )
```
### Table-based / Parameterized tests
This style of testing is used to exercise one piece of code with a comprehensive
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment