diff --git a/spec/localizer_test_model_deprecated_style.yml b/spec/localizer_test_model_deprecated_style.yml index 0d7cbd10..481997b2 100644 --- a/spec/localizer_test_model_deprecated_style.yml +++ b/spec/localizer_test_model_deprecated_style.yml @@ -4,3 +4,10 @@ en: localizer_test_model: aasm_state: opened: "It's open now!" + +fr: + activerecord: + attributes: + localizer_test_model: + aasm_state: + opened: "C'est ouvert maintenant!" diff --git a/spec/localizer_test_model_new_style.yml b/spec/localizer_test_model_new_style.yml index 7790a14e..5a054bde 100644 --- a/spec/localizer_test_model_new_style.yml +++ b/spec/localizer_test_model_new_style.yml @@ -3,3 +3,9 @@ en: attributes: localizer_test_model: aasm_state/opened: "It's open now!" + +fr: + activerecord: + attributes: + localizer_test_model: + aasm_state/opened: "C'est ouvert maintenant!" \ No newline at end of file diff --git a/spec/models/active_record/localizer_test_model.rb b/spec/models/active_record/localizer_test_model.rb index ace49cf5..3d175a52 100644 --- a/spec/models/active_record/localizer_test_model.rb +++ b/spec/models/active_record/localizer_test_model.rb @@ -24,11 +24,19 @@ class LocalizerTestModel < ActiveRecord::Base state = LocalizerTestModel.aasm.states.detect {|s| s == :opened} expect(state.localized_name).to eq("It's open now!") expect(state.human_name).to eq("It's open now!") + expect(state.display_name).to eq("It's open now!") + + I18n.with_locale(:fr) do + expect(state.localized_name).to eq("C'est ouvert maintenant!") + expect(state.human_name).to eq("C'est ouvert maintenant!") + expect(state.display_name).to eq("C'est ouvert maintenant!") + end end it 'should use fallback' do state = LocalizerTestModel.aasm.states.detect {|s| s == :closed} expect(state.localized_name).to eq('Closed') expect(state.human_name).to eq('Closed') + expect(state.display_name).to eq('Closed') end end