Skip to content

Commit

Permalink
Fix RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
rzane committed Jan 23, 2025
1 parent 5463db0 commit f066053
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions app/models/concerns/test_track/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ def connection
conn.use Faraday::Request::Json
conn.use Faraday::Response::Json, content_type: []
conn.use Faraday::Response::RaiseError
conn.options[:open_timeout] = (ENV['TEST_TRACK_OPEN_TIMEOUT'] || 2).to_i # Number of seconds to wait for the connection to open.
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).
# Number of seconds to wait for the connection to open.
conn.options[:open_timeout] = (ENV['TEST_TRACK_OPEN_TIMEOUT'] || 2).to_i
# Number of seconds to wait for one block to be read (via one read(2) call).
conn.options[:timeout] = (ENV['TEST_TRACK_TIMEOUT'] || 4).to_i
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/test_track/remote/assignment_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def save
request(
method: :post,
path: 'api/v1/assignment_event',
body: { context:, visitor_id:, split_name:, mixpanel_result: },
body: { context: context, visitor_id: visitor_id, split_name: split_name, mixpanel_result: mixpanel_result },
fake: nil
)

Expand Down
4 changes: 2 additions & 2 deletions app/models/test_track/remote/identifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def save
result = request(
method: :post,
path: 'api/v1/identifier',
body: { identifier_type:, visitor_id:, value: },
fake: { 'visitor' => { 'id' => visitor_id, 'assignments' => [] } }
body: { identifier_type: identifier_type, visitor_id: visitor_id, value: value },
fake: { visitor: { id: visitor_id, assignments: [] } }
)

self.visitor = result.fetch('visitor')
Expand Down
4 changes: 2 additions & 2 deletions app/models/test_track/remote/identifier_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def save
request(
method: :post,
path: 'api/v1/identifier_type',
body: { name: },
fake: nil,
body: { name: name },
fake: nil
)

true
Expand Down
6 changes: 3 additions & 3 deletions app/models/test_track/remote/split_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.destroy_existing(id)
request(
method: :delete,
path: "api/v1/split_configs/#{id}",
fake: nil,
fake: nil
)

nil
Expand All @@ -22,8 +22,8 @@ def save
request(
method: :post,
path: 'api/v1/split_configs',
body: { name:, weighting_registry: },
fake: nil,
body: { name: name, weighting_registry: weighting_registry },
fake: nil
)

true
Expand Down
6 changes: 3 additions & 3 deletions app/models/test_track/remote/visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.find(id)
result = request(
method: :get,
path: "api/v1/visitors/#{id}",
fake: fake_instance_attributes(nil),
fake: fake_instance_attributes(nil)
)

new(result)
Expand All @@ -22,7 +22,7 @@ def self.from_identifier(identifier_type, identifier_value)
result = request(
method: :get,
path: "api/v1/identifier_types/#{identifier_type}/identifiers/#{identifier_value}/visitor",
fake: fake_instance_attributes(nil),
fake: fake_instance_attributes(nil)
)

new(result)
Expand All @@ -47,6 +47,6 @@ def assignments=(values)
end

def to_visitor
TestTrack::Visitor.new(id:, assignments:)
TestTrack::Visitor.new(id: id, assignments: assignments)
end
end

0 comments on commit f066053

Please sign in to comment.