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
qbrick-2.5.0.pre spec/models/image_size_spec.rb
kuhsaft-2.4.3 spec/models/image_size_spec.rb
kuhsaft-2.4.2 spec/models/image_size_spec.rb
kuhsaft-2.4.1 spec/models/image_size_spec.rb
kuhsaft-2.4.0 spec/models/image_size_spec.rb
kuhsaft-2.3.6 spec/models/image_size_spec.rb
kuhsaft-2.3.5 spec/models/image_size_spec.rb
kuhsaft-2.3.4 spec/models/image_size_spec.rb
kuhsaft-2.3.3 spec/models/image_size_spec.rb
kuhsaft-2.3.2 spec/models/image_size_spec.rb
kuhsaft-2.3.1 spec/models/image_size_spec.rb
kuhsaft-2.3.0 spec/models/image_size_spec.rb
kuhsaft-2.2.6 spec/models/image_size_spec.rb
kuhsaft-2.2.5 spec/models/image_size_spec.rb
kuhsaft-2.2.4 spec/models/image_size_spec.rb
kuhsaft-2.2.3 spec/models/image_size_spec.rb
kuhsaft-2.2.2 spec/models/image_size_spec.rb
kuhsaft-2.2.1 spec/models/image_size_spec.rb
kuhsaft-2.2.0 spec/models/image_size_spec.rb
kuhsaft-2.1.2 spec/models/image_size_spec.rb