Skip to content

Commit

Permalink
Unify I18n.locale test (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilka2 authored Feb 7, 2025
1 parent 63f8b02 commit 4df8efa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/after_commit_everywhere_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
end
expect(handler).to have_received(:call).with(:de)
ensure
I18n.enforce_available_locales = true
I18n.enforce_available_locales = old_enforce_available_locales
end
end

Expand Down Expand Up @@ -307,6 +307,7 @@
end

it "preserves the locale" do
old_enforce_available_locales = I18n.enforce_available_locales
I18n.enforce_available_locales = false

ActiveRecord::Base.transaction do
Expand All @@ -315,8 +316,8 @@
expect(handler).not_to have_received(:call)
end
expect(handler).to have_received(:call).with(:de)

I18n.enforce_available_locales = true
ensure
I18n.enforce_available_locales = old_enforce_available_locales
end
end

Expand Down

0 comments on commit 4df8efa

Please sign in to comment.