Sha256: 849d7816600f414966bee63dcb9a9328c9aecffe993ee9912fd418248f0e5031

Contents?: true

Size: 808 Bytes

Versions: 52

Compression:

Stored size: 808 Bytes

Contents

require "rails_helper"

# TODO : test FR + EN

RSpec.describe "i18n" do
  Rails.application.eager_load!

  ::Dorsale::ApplicationRecord.descendants.each do |model|
    next unless model.to_s.start_with?("Dorsale")

    it "should i18n #{model} model name" do
      i18n = model.model_name.human(default: "")
      expect(i18n).to be_present
    end

    model.column_names.each do |column_name|
      next if column_name.end_with?("_type")
      next if column_name.end_with?("_bak")
      next if column_name.start_with?("old_")

      # user_id => user
      column_name = column_name[0..-4] if column_name.end_with?("_id")

      it "should i18n #{model}##{column_name}" do
        i18n = model.human_attribute_name(column_name, default: "")
        expect(i18n).to be_present
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
dorsale-4.0.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.20.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.19.1 spec/models/dorsale/i18n_spec.rb
dorsale-3.19.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.18.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.17.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.16.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.15.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.11 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.10 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.9 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.8 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.7 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.6 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.5 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.3 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.2 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.1 spec/models/dorsale/i18n_spec.rb
dorsale-3.14.0 spec/models/dorsale/i18n_spec.rb
dorsale-3.13.0 spec/models/dorsale/i18n_spec.rb