Sha256: 9572fbd1f3a66be0d5c9de74dc6a49ad92ff3ae9eae0863f84bd12e78d41583c
Contents?: true
Size: 1.26 KB
Versions: 3
Compression:
Stored size: 1.26 KB
Contents
require 'spec_helper' describe LocalesHelper do describe '#formatted_locale' do it do expect( helper.formatted_locale(:en) ).to eq('Language : English') end end describe '#i18n_helper' do before { I18n.locale = locale } # after { I18n.locale = I18n.default_locale } context 'en' do let(:locale) { :en } let(:data) do [ ['en', 'English'], ['fr', 'French'] ] end it do expect( helper.i18n_helper ).to eq data end end context 'fr' do let(:locale) { :fr } let(:data) do [ ['en', 'Anglais'], ['fr', 'Français'] ] end it do expect( helper.i18n_helper ).to eq data end end end describe 'i18n_helper_link' do before { I18n.locale = :en } after { I18n.locale = I18n.default_locale } context 'en' do let(:data) do [ "<a data-method=\"post\" href=\"/locales/en\" rel=\"nofollow\">English</a>", "<a data-method=\"post\" href=\"/locales/fr\" rel=\"nofollow\">French</a>" ] end it do expect( helper.i18n_helper_link ).to eq data end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
i18n_helper-0.0.3 | spec/helpers/locales_helper_spec.rb |
i18n_helper-0.0.2 | spec/helpers/locales_helper_spec.rb |
i18n_helper-0.0.1 | spec/helpers/locales_helper_spec.rb |