Skip to content

Commit f066053

Browse files
committed
Fix RuboCop
1 parent 5463db0 commit f066053

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

app/models/concerns/test_track/resource.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ def connection
1919
conn.use Faraday::Request::Json
2020
conn.use Faraday::Response::Json, content_type: []
2121
conn.use Faraday::Response::RaiseError
22-
conn.options[:open_timeout] = (ENV['TEST_TRACK_OPEN_TIMEOUT'] || 2).to_i # Number of seconds to wait for the connection to open.
23-
conn.options[:timeout] = (ENV['TEST_TRACK_TIMEOUT'] || 4).to_i # Number of seconds to wait for one block to be read (via one read(2) call).
22+
# Number of seconds to wait for the connection to open.
23+
conn.options[:open_timeout] = (ENV['TEST_TRACK_OPEN_TIMEOUT'] || 2).to_i
24+
# Number of seconds to wait for one block to be read (via one read(2) call).
25+
conn.options[:timeout] = (ENV['TEST_TRACK_TIMEOUT'] || 4).to_i
2426
end
2527
end
2628
end

app/models/test_track/remote/assignment_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def save
2424
request(
2525
method: :post,
2626
path: 'api/v1/assignment_event',
27-
body: { context:, visitor_id:, split_name:, mixpanel_result: },
27+
body: { context: context, visitor_id: visitor_id, split_name: split_name, mixpanel_result: mixpanel_result },
2828
fake: nil
2929
)
3030

app/models/test_track/remote/identifier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def save
2828
result = request(
2929
method: :post,
3030
path: 'api/v1/identifier',
31-
body: { identifier_type:, visitor_id:, value: },
32-
fake: { 'visitor' => { 'id' => visitor_id, 'assignments' => [] } }
31+
body: { identifier_type: identifier_type, visitor_id: visitor_id, value: value },
32+
fake: { visitor: { id: visitor_id, assignments: [] } }
3333
)
3434

3535
self.visitor = result.fetch('visitor')

app/models/test_track/remote/identifier_type.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def save
1111
request(
1212
method: :post,
1313
path: 'api/v1/identifier_type',
14-
body: { name: },
15-
fake: nil,
14+
body: { name: name },
15+
fake: nil
1616
)
1717

1818
true

app/models/test_track/remote/split_config.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.destroy_existing(id)
1010
request(
1111
method: :delete,
1212
path: "api/v1/split_configs/#{id}",
13-
fake: nil,
13+
fake: nil
1414
)
1515

1616
nil
@@ -22,8 +22,8 @@ def save
2222
request(
2323
method: :post,
2424
path: 'api/v1/split_configs',
25-
body: { name:, weighting_registry: },
26-
fake: nil,
25+
body: { name: name, weighting_registry: weighting_registry },
26+
fake: nil
2727
)
2828

2929
true

app/models/test_track/remote/visitor.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.find(id)
99
result = request(
1010
method: :get,
1111
path: "api/v1/visitors/#{id}",
12-
fake: fake_instance_attributes(nil),
12+
fake: fake_instance_attributes(nil)
1313
)
1414

1515
new(result)
@@ -22,7 +22,7 @@ def self.from_identifier(identifier_type, identifier_value)
2222
result = request(
2323
method: :get,
2424
path: "api/v1/identifier_types/#{identifier_type}/identifiers/#{identifier_value}/visitor",
25-
fake: fake_instance_attributes(nil),
25+
fake: fake_instance_attributes(nil)
2626
)
2727

2828
new(result)
@@ -47,6 +47,6 @@ def assignments=(values)
4747
end
4848

4949
def to_visitor
50-
TestTrack::Visitor.new(id:, assignments:)
50+
TestTrack::Visitor.new(id: id, assignments: assignments)
5151
end
5252
end

0 commit comments

Comments
 (0)