Sha256: 4609fbece3fd04339ba2c6643366f4e9523d6175d8612d24a5daf04091476ae4

Contents?: true

Size: 758 Bytes

Versions: 6

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::ImageBrick do

  let :image_brick do
    Kuhsaft::ImageBrick.new
  end

  describe '#valid' do
    before do
      image_brick.valid?
    end

    context 'without an #image' do
      it 'has en error' do
        image_brick.should have(1).error_on(:image)
      end
    end
  end

  describe '#save' do
    context 'when changing the image size' do
      it 'regenerates the image version' do
        image_brick.stub(:image_size_changed?).and_return(true)
        image_brick.image.should_receive(:recreate_versions!)
        image_brick.resize_image_if_size_changed
      end
    end
  end

  describe '#bricks' do
    it 'can not have childs' do
      image_brick.should_not respond_to(:bricks)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuhsaft-1.1.1 spec/models/image_brick_spec.rb
kuhsaft-1.1.0 spec/models/image_brick_spec.rb
kuhsaft-1.0.3 spec/models/image_brick_spec.rb
kuhsaft-1.0.2 spec/models/image_brick_spec.rb
kuhsaft-1.0.1 spec/models/image_brick_spec.rb
kuhsaft-1.0.0 spec/models/image_brick_spec.rb