Skip to content

Commit

Permalink
Remove tests for Rails versions less or equal to 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoj committed May 28, 2024
1 parent cc20e7c commit 7f1d6f9
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions spec/requests/active_record_sql_metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
end

it "writes metric" do
skip("https://github.com/rails/rails/issues/30586") unless payload_names_fixed_in_rails?

get "/metrics"

expect_metric(
Expand All @@ -34,27 +32,6 @@
)
end

it "writes metric" do
skip("https://github.com/rails/rails/issues/30586") if payload_names_fixed_in_rails?

get "/metrics"

expect_metric(
tags: a_hash_including(
hook: "sql",
name: "SQL",
class_name: "SQL",
operation: "INSERT"
),
fields: a_hash_including(
additional_field: :value,
request_id: :request_id,
value: be_between(1, 500),
sql: "INSERT INTO \"metrics\" (\"name\", \"created_at\", \"updated_at\") VALUES (xxx)"
)
)
end

it "includes correct timestamps" do
travel_to Time.zone.local(2018, 1, 1, 9, 0, 0)

Expand All @@ -80,14 +57,4 @@
)
)
end

def payload_names_fixed_in_rails?
Rails::VERSION::MAJOR > 5 ||
rails_after_5_1?
end

def rails_after_5_1?
Rails::VERSION::MAJOR == 5 &&
Rails::VERSION::MINOR > 1
end
end

0 comments on commit 7f1d6f9

Please sign in to comment.