File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 128128 expect { importer . import_items! } . to raise_error ( ArgumentError )
129129 expect ( Item . count ) . to eq ( count_before )
130130 end
131+
132+ it 'fails if an item does not have an image attribute' do
133+ importer . factories . first . attributes [ :image ] = nil
134+ stub_request ( :head , thumbnail_uri ) . to_return ( status : 200 )
135+
136+ count_before = Item . count
137+ expect { importer . import_items! } . to raise_error ( ArgumentError )
138+ expect ( Item . count ) . to eq ( count_before )
139+ end
140+
141+ it 'fails if an item does not have a thumbnail attribute' do
142+ importer . factories . first . attributes [ :thumbnail ] = nil
143+ stub_request ( :head , image_uri ) . to_return ( status : 200 )
144+
145+ count_before = Item . count
146+ expect { importer . import_items! } . to raise_error ( ArgumentError )
147+ expect ( Item . count ) . to eq ( count_before )
148+ end
131149 end
132150
133151 context 'without validation' do
You can’t perform that action at this time.
0 commit comments