Sha256: 9a4a93b14f17d84fe5ca8578736d5f8392484715c7535c31e764eb63bf0bef52

Contents?: true

Size: 872 Bytes

Versions: 16

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'

describe Qbrick::ImageSize, type: :model do
  before do
    Qbrick::ImageSize.build_defaults!
  end

  describe '.build_defaults!' do
    it 'sets the default sizes' do
      expect(Qbrick::ImageSize.all).to eq([Qbrick::ImageSize.gallery_size,
                                           Qbrick::ImageSize.teaser_size])
    end
  end

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

    it 'empties the list' do
      expect(Qbrick::ImageSize.all).to be_empty
    end
  end

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

  describe '.find_by_name' do
    it 'returns the size' do
      expect(Qbrick::ImageSize.find_by_name('gallery')).to eq(Qbrick::ImageSize.gallery_size)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 spec/models/image_size_spec.rb
qbrick-2.7 spec/models/image_size_spec.rb
qbrick-2.6.10 spec/models/image_size_spec.rb
qbrick-2.6.9 spec/models/image_size_spec.rb
qbrick-2.6.8 spec/models/image_size_spec.rb
qbrick-2.6.7 spec/models/image_size_spec.rb
qbrick-2.6.6 spec/models/image_size_spec.rb
qbrick-2.6.5 spec/models/image_size_spec.rb
qbrick-2.6.4 spec/models/image_size_spec.rb
qbrick-2.6.3 spec/models/image_size_spec.rb
qbrick-2.6.2 spec/models/image_size_spec.rb
qbrick-2.6.1 spec/models/image_size_spec.rb
qbrick-2.6.0 spec/models/image_size_spec.rb
qbrick-2.5.2 spec/models/image_size_spec.rb
qbrick-2.5.1 spec/models/image_size_spec.rb
qbrick-2.5.0 spec/models/image_size_spec.rb