Sha256: e42401663c5bc1d2d3f67bb4a269a50459a5bffcd80c7ada251af94be1fa9c5c

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

require 'spec_helper'
include Brightcontent::TranslationHelper

describe Brightcontent::TranslationHelper do
  let(:string) { "thing" }
  let(:model) { Brightcontent::AdminUser }

  describe '#nominative_plural' do
    it "pluralizes strings" do
      expect(nominative_plural(string)).to eq("things")
    end

    it "pluralizes active record models" do
      expect(nominative_plural(model)).to eq("Admins")
    end
  end

  describe '#nominative_singular' do
    it "returns a singular strings" do
      expect(nominative_singular(string)).to eq("thing")
    end

    it "deals with active record models" do
      expect(nominative_singular(model)).to eq("Admin")
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brightcontent-core-2.6.0 spec/helpers/brightcontent/translation_helper_spec.rb
brightcontent-core-2.5.1 spec/helpers/brightcontent/translation_helper_spec.rb
brightcontent-core-2.5.0 spec/helpers/brightcontent/translation_helper_spec.rb