Sha256: 95abc1ee03e5ef86339d66d3c0d03f93147ee6e6d8f2fc88bbf6cae1af78fe50

Contents?: true

Size: 852 Bytes

Versions: 62

Compression:

Stored size: 852 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::ImageSize do
  before do
    Kuhsaft::ImageSize.build_defaults!
  end

  describe '.build_defaults!' do
    it 'sets the default sizes' do
      Kuhsaft::ImageSize.all.should == [Kuhsaft::ImageSize.gallery_size,
                                        Kuhsaft::ImageSize.teaser_size]
    end
  end

  describe '.clear!' do
    before do
      Kuhsaft::ImageSize.clear!
    end

    it 'empties the list' do
      Kuhsaft::ImageSize.all.should be_empty
    end
  end

  describe '.add' do
    it 'adds a new image size' do
      expect { Kuhsaft::ImageSize.add(:stuff, 200, 100) }.to change(Kuhsaft::ImageSize.all, :count).by(1)
    end
  end

  describe '.find_by_name' do
    it 'returns the size' do
      Kuhsaft::ImageSize.find_by_name('gallery').should == Kuhsaft::ImageSize.gallery_size
    end
  end
end

Version data entries

62 entries across 62 versions & 2 rubygems

Version Path
kuhsaft-2.1.1 spec/models/image_size_spec.rb
kuhsaft-2.1.0 spec/models/image_size_spec.rb
kuhsaft-1.8.6 spec/models/image_size_spec.rb
kuhsaft-1.8.5 spec/models/image_size_spec.rb
kuhsaft-2.0.3 spec/models/image_size_spec.rb
kuhsaft-2.0.2 spec/models/image_size_spec.rb
kuhsaft-1.8.4 spec/models/image_size_spec.rb
kuhsaft-1.8.1 spec/models/image_size_spec.rb
kuhsaft-2.0.1 spec/models/image_size_spec.rb
kuhsaft-2.0.0 spec/models/image_size_spec.rb
kuhsaft-1.8.0 spec/models/image_size_spec.rb
kuhsaft-1.7.1 spec/models/image_size_spec.rb
kuhsaft-1.7.0 spec/models/image_size_spec.rb
kuhsaft-1.6.0 spec/models/image_size_spec.rb
kuhsaft-1.5.0 spec/models/image_size_spec.rb
kuhsaft-1.4.3 spec/models/image_size_spec.rb
kuhsaft-1.4.2 spec/models/image_size_spec.rb
kuhsaft-1.4.1 spec/models/image_size_spec.rb
kuhsaft-1.4.0 spec/models/image_size_spec.rb
kuhsaft-1.3.1 spec/models/image_size_spec.rb