Skip to content

Commit

Permalink
Enable analytics on all geocoding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scruti committed Jan 31, 2025
1 parent c1f81b8 commit 5992754
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/lib/geocoding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "geocoding"

# rubocop:disable RSpec/ExpectActual
RSpec.describe Geocoding, geocode: true do
RSpec.describe Geocoding, :dfe_analytics, geocode: true do
subject { described_class.new(location) }

let(:google_coordinates) { [54.5399146, -1.0435559] }
Expand All @@ -29,7 +29,7 @@
subject.coordinates
end

it "does not trigger a Google Geocoding API hit event", :dfe_analytics do
it "does not trigger a Google Geocoding API hit event" do
subject.coordinates
expect(:google_geocoding_api_hit).not_to have_been_enqueued_as_analytics_event
end
Expand All @@ -41,7 +41,7 @@
expect(subject.coordinates).to eq(google_coordinates)
end

it "triggers a Google Geocoding API hit event", :dfe_analytics do
it "triggers a Google Geocoding API hit event" do
subject.coordinates
expect(:google_geocoding_api_hit).to have_been_enqueued_as_analytics_event(
with_data: { type: "coordinates", location: location, result: google_coordinates.to_s },
Expand All @@ -54,7 +54,7 @@
expect(subject.coordinates).to eq(no_match)
end

it "triggers a Google Geocoding API hit event", :dfe_analytics do
it "triggers a Google Geocoding API hit event" do
subject.coordinates
expect(:google_geocoding_api_hit).to have_been_enqueued_as_analytics_event(
with_data: { type: "coordinates", location: location, result: nil },
Expand All @@ -68,7 +68,7 @@
subject.coordinates
end

it "triggers a Google Geocoding API hit event", :dfe_analytics do
it "triggers a Google Geocoding API hit event" do
subject.coordinates
expect(:google_geocoding_api_hit).to have_been_enqueued_as_analytics_event(
with_data: { type: "coordinates", location: location, result: "OVER_QUERY_LIMIT" },
Expand Down Expand Up @@ -113,7 +113,7 @@
subject.postcode_from_coordinates
end

it "does not trigger a Google Geocoding API hit event", :dfe_analytics do
it "does not trigger a Google Geocoding API hit event" do
subject.postcode_from_coordinates
expect(:google_geocoding_api_hit).not_to have_been_enqueued_as_analytics_event
end
Expand All @@ -125,7 +125,7 @@
expect(subject.postcode_from_coordinates).to eq(postcode)
end

it "triggers a Google Geocoding API hit event", :dfe_analytics do
it "triggers a Google Geocoding API hit event" do
subject.postcode_from_coordinates
expect(:google_geocoding_api_hit).to have_been_enqueued_as_analytics_event(
with_data: { type: "postcode", location: google_coordinates.to_s, result: postcode },
Expand All @@ -138,7 +138,7 @@
expect(subject.postcode_from_coordinates).to be_nil
end

it "triggers a Google Geocoding API hit event", :dfe_analytics do
it "triggers a Google Geocoding API hit event" do
subject.postcode_from_coordinates
expect(:google_geocoding_api_hit).to have_been_enqueued_as_analytics_event(
with_data: { type: "postcode", location: google_coordinates.to_s, result: nil },
Expand All @@ -153,7 +153,7 @@
subject.postcode_from_coordinates
end

it "triggers a Google Geocoding API hit event", :dfe_analytics do
it "triggers a Google Geocoding API hit event" do
subject.postcode_from_coordinates
expect(:google_geocoding_api_hit).to have_been_enqueued_as_analytics_event(
with_data: { type: "postcode", location: google_coordinates.to_s, result: "OVER_QUERY_LIMIT" },
Expand Down

0 comments on commit 5992754

Please sign in to comment.