Skip to content

Commit

Permalink
Read AS MemoryStore value via public API
Browse files Browse the repository at this point in the history
because Rails 7.1 changed its implementation to hold the `@data` ivar as a marshalled String
  • Loading branch information
amatsuda committed Jun 2, 2023
1 parent 4045d30 commit 8aa685a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/backend/cache_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def teardown
I18n.t(:missing, :scope => :foo, :extra => true)
assert_equal 1, I18n.cache_store.instance_variable_get(:@data).size

_, entry = I18n.cache_store.instance_variable_get(:@data).first
assert_equal({ scope: :foo }, entry.value.options)
value = I18n.cache_store.read(I18n.cache_store.instance_variable_get(:@data).keys.first)

assert_equal({ scope: :foo }, value.options)
end

test "uses 'i18n' as a cache key namespace by default" do
Expand Down

0 comments on commit 8aa685a

Please sign in to comment.