Skip to content

Commit 7a40b83

Browse files
committed
resolves indentation issues
1 parent 4401f08 commit 7a40b83

File tree

2 files changed

+66
-45
lines changed

2 files changed

+66
-45
lines changed

spec/event_builder_spec.rb

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@
110110
end
111111

112112
it 'should create a valid Event when create_impression_event is called with attributes as a string value' do
113-
@expected_impression_params[:visitors][0][:attributes].unshift(entity_id: '111094',
114-
key: 'browser_type',
115-
type: 'custom',
116-
value: 'firefox')
113+
@expected_impression_params[:visitors][0][:attributes].unshift(
114+
entity_id: '111094',
115+
key: 'browser_type',
116+
type: 'custom',
117+
value: 'firefox'
118+
)
117119

118120
experiment = config.get_experiment_from_key('test_experiment')
119121
impression_event = @event_builder.create_impression_event(experiment, '111128', 'test_user',
@@ -124,10 +126,12 @@
124126
end
125127

126128
it 'should create a valid Event when create_impression_event is called with attributes as a false value' do
127-
@expected_impression_params[:visitors][0][:attributes].unshift(entity_id: '111094',
128-
key: 'browser_type',
129-
type: 'custom',
130-
value: false)
129+
@expected_impression_params[:visitors][0][:attributes].unshift(
130+
entity_id: '111094',
131+
key: 'browser_type',
132+
type: 'custom',
133+
value: false
134+
)
131135

132136
experiment = config.get_experiment_from_key('test_experiment')
133137
impression_event = @event_builder.create_impression_event(experiment, '111128', 'test_user',
@@ -138,10 +142,12 @@
138142
end
139143

140144
it 'should create a valid Event when create_impression_event is called with attributes as a zero value' do
141-
@expected_impression_params[:visitors][0][:attributes].unshift(entity_id: '111094',
142-
key: 'browser_type',
143-
type: 'custom',
144-
value: 0)
145+
@expected_impression_params[:visitors][0][:attributes].unshift(
146+
entity_id: '111094',
147+
key: 'browser_type',
148+
type: 'custom',
149+
value: 0
150+
)
145151

146152
experiment = config.get_experiment_from_key('test_experiment')
147153
impression_event = @event_builder.create_impression_event(experiment, '111128', 'test_user', 'browser_type' => 0)
@@ -167,10 +173,12 @@
167173
end
168174

169175
it 'should create a valid Event when create_conversion_event is called with attributes' do
170-
@expected_conversion_params[:visitors][0][:attributes].unshift(entity_id: '111094',
171-
key: 'browser_type',
172-
type: 'custom',
173-
value: 'firefox')
176+
@expected_conversion_params[:visitors][0][:attributes].unshift(
177+
entity_id: '111094',
178+
key: 'browser_type',
179+
type: 'custom',
180+
value: 'firefox'
181+
)
174182

175183
conversion_event = @event_builder.create_conversion_event('test_event', 'test_user', {'browser_type' => 'firefox'},
176184
nil, '111127' => '111128')
@@ -343,10 +351,12 @@
343351
value: 13.37,
344352
tags: event_tags)
345353

346-
@expected_conversion_params[:visitors][0][:attributes].unshift(entity_id: '111094',
347-
key: 'browser_type',
348-
type: 'custom',
349-
value: 'firefox')
354+
@expected_conversion_params[:visitors][0][:attributes].unshift(
355+
entity_id: '111094',
356+
key: 'browser_type',
357+
type: 'custom',
358+
value: 'firefox'
359+
)
350360

351361
conversion_event = @event_builder.create_conversion_event('test_event', 'test_user', {'browser_type' => 'firefox'},
352362
event_tags, '111127' => '111128')
@@ -441,15 +451,18 @@
441451

442452
# Create conversion event with bucketing ID
443453
it 'should create valid Event when create_conversion_event is called with Bucketing ID attribute' do
444-
@expected_conversion_params[:visitors][0][:attributes].unshift({
445-
entity_id: '111094',
446-
key: 'browser_type',
447-
type: 'custom',
448-
value: 'firefox'
449-
}, entity_id: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'],
450-
key: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'],
451-
type: 'custom',
452-
value: 'variation')
454+
@expected_conversion_params[:visitors][0][:attributes].unshift(
455+
{
456+
entity_id: '111094',
457+
key: 'browser_type',
458+
type: 'custom',
459+
value: 'firefox'
460+
},
461+
entity_id: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'],
462+
key: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'],
463+
type: 'custom',
464+
value: 'variation'
465+
)
453466

454467
user_attributes = {
455468
'browser_type' => 'firefox',

spec/project_spec.rb

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,12 @@ class InvalidErrorHandler; end
192192

193193
it 'should properly activate a user, (with attributes provided) when there is an audience match' do
194194
params = @expected_activate_params
195-
params[:visitors][0][:attributes].unshift(entity_id: '111094',
196-
key: 'browser_type',
197-
type: 'custom',
198-
value: 'firefox')
195+
params[:visitors][0][:attributes].unshift(
196+
entity_id: '111094',
197+
key: 'browser_type',
198+
type: 'custom',
199+
value: 'firefox'
200+
)
199201
params[:visitors][0][:snapshots][0][:decisions] = [{
200202
campaign_id: '3',
201203
experiment_id: '122227',
@@ -215,10 +217,12 @@ class InvalidErrorHandler; end
215217

216218
it 'should properly activate a user, (with attributes provided) when there is an audience match after a force variation call' do
217219
params = @expected_activate_params
218-
params[:visitors][0][:attributes].unshift(entity_id: '111094',
219-
key: 'browser_type',
220-
type: 'custom',
221-
value: 'firefox')
220+
params[:visitors][0][:attributes].unshift(
221+
entity_id: '111094',
222+
key: 'browser_type',
223+
type: 'custom',
224+
value: 'firefox'
225+
)
222226
params[:visitors][0][:snapshots][0][:decisions] = [{
223227
campaign_id: '3',
224228
experiment_id: '122227',
@@ -478,10 +482,12 @@ class InvalidErrorHandler; end
478482

479483
it 'should properly track an event by calling dispatch_event with right params with attributes provided' do
480484
params = @expected_track_event_params
481-
params[:visitors][0][:attributes].unshift(entity_id: '111094',
482-
key: 'browser_type',
483-
type: 'custom',
484-
value: 'firefox')
485+
params[:visitors][0][:attributes].unshift(
486+
entity_id: '111094',
487+
key: 'browser_type',
488+
type: 'custom',
489+
value: 'firefox'
490+
)
485491
params[:visitors][0][:snapshots][0][:decisions] = [{
486492
campaign_id: '3',
487493
experiment_id: '122227',
@@ -560,10 +566,12 @@ class InvalidErrorHandler; end
560566
it 'should override the audience check if the user is whitelisted to a specific variation' do
561567
params = @expected_track_event_params
562568
params[:visitors][0][:visitor_id] = 'forced_audience_user'
563-
params[:visitors][0][:attributes].unshift(entity_id: '111094',
564-
key: 'browser_type',
565-
type: 'custom',
566-
value: 'wrong_browser')
569+
params[:visitors][0][:attributes].unshift(
570+
entity_id: '111094',
571+
key: 'browser_type',
572+
type: 'custom',
573+
value: 'wrong_browser'
574+
)
567575
params[:visitors][0][:snapshots][0][:decisions] = [{
568576
campaign_id: '3',
569577
experiment_id: '122227',

0 commit comments

Comments
 (0)