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
42612832
Commit
42612832
authored
May 03, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for 3 cases as suggestion on MR
parent
deabcd8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
spec/lib/generators/gitlab/snowplow_event_definition_generator_spec.rb
...rators/gitlab/snowplow_event_definition_generator_spec.rb
+18
-5
No files found.
spec/lib/generators/gitlab/snowplow_event_definition_generator_spec.rb
View file @
42612832
...
...
@@ -32,15 +32,28 @@ RSpec.describe Gitlab::SnowplowEventDefinitionGenerator do
expect
(
::
Gitlab
::
Config
::
Loader
::
Yaml
.
new
(
File
.
read
(
event_definition_path
)).
load_raw!
).
to
eq
(
sample_event
)
end
it
'overwrites event definition file using the template'
do
context
'event definition already exists'
do
before
do
stub_const
(
'Gitlab::VERSION'
,
'12.11.0-pre'
)
described_class
.
new
([],
generator_options
).
invoke_all
end
it
'overwrites event definition --ff flag set to true'
do
sample_event
=
::
Gitlab
::
Config
::
Loader
::
Yaml
.
new
(
fixture_file
(
File
.
join
(
sample_event_dir
,
'sample_event.yml'
))).
load_raw!
stub_const
(
'Gitlab::VERSION'
,
'13.11.0-pre'
)
described_class
.
new
([],
generator_options
.
merge
(
'ff'
=>
true
)).
invoke_all
event_definition_path
=
File
.
join
(
ce_temp_dir
,
'groups__email_campaigns_controller_click.yml'
)
expect
(
::
Gitlab
::
Config
::
Loader
::
Yaml
.
new
(
File
.
read
(
event_definition_path
)).
load_raw!
).
to
eq
(
sample_event
)
end
it
'raises error when --ff flag set to false'
do
expect
{
described_class
.
new
([],
generator_options
.
merge
(
'ff'
=>
false
)).
invoke_all
}
.
to
raise_error
(
StandardError
,
/Event definition already exists at/
)
end
end
it
'creates EE event definition file using the template'
do
sample_event
=
::
Gitlab
::
Config
::
Loader
::
Yaml
.
new
(
fixture_file
(
File
.
join
(
sample_event_dir
,
'sample_event_ee.yml'
))).
load_raw!
...
...
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