Sha256: 26d6e9ee6f926620ffeae859182f6b84335d7a1893e828806b52c16a79ed3c6b

Contents?: true

Size: 983 Bytes

Versions: 20

Compression:

Stored size: 983 Bytes

Contents

require 'spec_helper'

describe 'Plural cache' do
  it 'caches pluralizations' do
    cache = Paperclip::Interpolations::PluralCache.new
    symbol = :box

    first = cache.pluralize_symbol(symbol)
    second = cache.pluralize_symbol(symbol)
    expect(first).to equal(second)
  end

  it 'caches pluralizations and underscores' do
    class BigBox ; end
    cache = Paperclip::Interpolations::PluralCache.new
    klass = BigBox

    first = cache.underscore_and_pluralize_class(klass)
    second = cache.underscore_and_pluralize_class(klass)
    expect(first).to equal(second)
  end

  it 'pluralizes words' do
    cache = Paperclip::Interpolations::PluralCache.new
    symbol = :box

    expect(cache.pluralize_symbol(symbol)).to eq("boxes")
  end

  it 'pluralizes and underscore class names' do
    class BigBox ; end
    cache = Paperclip::Interpolations::PluralCache.new
    klass = BigBox

    expect(cache.underscore_and_pluralize_class(klass)).to eq("big_boxes")
  end
end

Version data entries

20 entries across 20 versions & 5 rubygems

Version Path
kt-paperclip-5.4.0 spec/paperclip/plural_cache_spec.rb
kt-paperclip-4.4.0 spec/paperclip/plural_cache_spec.rb
paperclip-6.1.0 spec/paperclip/plural_cache_spec.rb
paperclip-6.0.0 spec/paperclip/plural_cache_spec.rb
paperclip-5.3.0 spec/paperclip/plural_cache_spec.rb
paperclip-5.2.1 spec/paperclip/plural_cache_spec.rb
paperclip-5.2.0 spec/paperclip/plural_cache_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paperclip-5.1.0/spec/paperclip/plural_cache_spec.rb
paperclip-5.1.0 spec/paperclip/plural_cache_spec.rb
paperclip-5.0.0 spec/paperclip/plural_cache_spec.rb
paperclip-4.3.7 spec/paperclip/plural_cache_spec.rb
paperclip_jk-5.0.0.beta2 spec/paperclip/plural_cache_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/spec/paperclip/plural_cache_spec.rb
paperclip-5.0.0.beta2 spec/paperclip/plural_cache_spec.rb
paperclip-5.0.0.beta1 spec/paperclip/plural_cache_spec.rb
paperclip-4.3.6 spec/paperclip/plural_cache_spec.rb
paperclip-4.3.5 spec/paperclip/plural_cache_spec.rb
paperclip-4.3.4 spec/paperclip/plural_cache_spec.rb
paperclip-4.3.3 spec/paperclip/plural_cache_spec.rb
paperclip-4.3.2 spec/paperclip/plural_cache_spec.rb