Sha256: 81f15b41dc86affe29ddefc4f60dce60aa023ac6bbe33875f66cadb756981a19
Contents?: true
Size: 901 Bytes
Versions: 15
Compression:
Stored size: 901 Bytes
Contents
require 'spec_helper' describe LinkThumbnailer::Models::Website do let(:instance) { described_class.new } it { expect(instance.images).to be_empty } describe '#image=' do let(:image) { double } let(:action) { instance.image = image } before do image.stub(:valid?).and_return(true) end it { expect { action }.to change { instance.images.size }.by(1) } end describe '#images=' do let(:image) { double } let(:action) { instance.images = image } context 'when image is valid' do before do image.stub(:valid?).and_return(true) end it { expect { action }.to change { instance.images.size }.by(1) } end context 'when image is not valid' do before do image.stub(:valid?).and_return(false) end it { expect { action }.to_not change { instance.images.size } } end end end
Version data entries
15 entries across 15 versions & 1 rubygems