Sha256: c45b9a2460aacbeffe042495743706ec333d593e526b9ad2d70fdd1749028416

Contents?: true

Size: 1.29 KB

Versions: 48

Compression:

Stored size: 1.29 KB

Contents

require 'rails_helper'

RSpec.describe 'Translations', type: :model do
  {
    Cmor::Galleries::PictureGallery => {},
    Cmor::Galleries::PictureDetail  => {},
  }.each do |model, options|
    I18n.available_locales.each do |locale|
      I18n.locale = locale

      describe "for locale #{locale}:" do
        describe "#{model} translations" do
          it 'include one' do
            I18n.locale = locale
            i18n_key = ['activerecord', 'models', model.name.underscore].join('.')
            i18n_options = {}
            expect(I18n.translate!(i18n_key, options)[:one]).to be_a(String)
          end

          it 'include other' do
            I18n.locale = locale
            i18n_key = ['activerecord', 'models', model.name.underscore].join('.')
            i18n_options = {}
            expect(I18n.translate!(i18n_key, options)[:other]).to be_a(String)
          end

          describe 'for attributes' do

            model.column_names.each do |column_name|
              it "include #{column_name}" do
                I18n.locale = locale
                i18n_key = ['activerecord', 'attributes', model.name.underscore, column_name].join('.')
                expect(I18n.translate!(i18n_key)).to be_a(String)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
cmor_galleries-0.0.51.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.50.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.49.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.48.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.45.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.44.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.43.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.42.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.41.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.40.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.39.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.38.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.37.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.36.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.35.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.34.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.33.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.32.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.31.pre spec/models/i18n_spec.rb
cmor_galleries-0.0.30.pre spec/models/i18n_spec.rb