Sha256: 19954be52629c4ce51a0ff2f4612956256b3b4dcdb3c25081e89bd7eb29c46b1

Contents?: true

Size: 841 Bytes

Versions: 10

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'
require 'orm/models/person'

describe "translation and naming" do
  before do
    I18n.backend = I18n::Backend::Simple.new
  end

  describe "of an attribute" do
    before do
      I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:name => "person's name"} } }
    end

    it "should look up an by a string" do
      Person.human_attribute_name("name").should == "person's name"
    end

    it "should look up an by a symbol" do
      Person.human_attribute_name(:name).should == "person's name"
    end
  end

  describe "of a model" do
    before do
      I18n.backend.store_translations 'en', :activemodel => {:models => {:person => 'A person object'}}
    end

    it "should return it's human name" do
      Person.model_name.human.should == "A person object"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
massive_record-0.2.2 spec/orm/cases/i18n_spec.rb
massive_record-0.2.2.rc2 spec/orm/cases/i18n_spec.rb
massive_record-0.2.2.rc1 spec/orm/cases/i18n_spec.rb
massive_record-0.2.1 spec/orm/cases/i18n_spec.rb
massive_record-0.2.1.rc1 spec/orm/cases/i18n_spec.rb
massive_record-0.2.0 spec/orm/cases/i18n_spec.rb
massive_record-0.2.0.beta2 spec/orm/cases/i18n_spec.rb
massive_record-0.2.0.beta spec/orm/cases/i18n_spec.rb
massive_record-0.1.1 spec/orm/cases/i18n_spec.rb
massive_record-0.1.0 spec/orm/cases/i18n_spec.rb