mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
d92d548d42
Fix a bug where shoulda was raising an exception, when a translation in en.yml was modified to include %{attribute} or %{model}
10 lines
242 B
Ruby
10 lines
242 B
Ruby
module I18nFaker
|
|
def stub_translation(key, message)
|
|
yml = key.split('.').reverse.inject(message) { |a, n| { n => a } }
|
|
I18n.backend.store_translations(:en, yml)
|
|
end
|
|
end
|
|
|
|
RSpec.configure do |config|
|
|
config.include I18nFaker
|
|
end
|