File tree Expand file tree Collapse file tree
spec/service/active_storage/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 141141 expect ( download_block ) . to eq fixture_data
142142 end
143143 end
144+
145+ context "with download a block and when the attachment is not found" do
146+ let ( :download_block ) do
147+ service . download ( "#{ key } !" ) do |_data | # rubocop:disable Lint/EmptyBlock
148+ end
149+ end
150+
151+ it { expect { download_block } . to raise_exception ( ActiveStorage ::FileNotFoundError ) }
152+ end
144153 end
145154 end
146155
154163 after { service . delete ( key ) }
155164
156165 it { is_expected . to eq fixture_data [ range ] }
166+
167+ context "when the attachment is not found" do
168+ subject ( :download_chunk ) { service . download_chunk ( "#{ key } !" , range ) }
169+
170+ it { expect { download_chunk } . to raise_exception ( ActiveStorage ::FileNotFoundError ) }
171+ end
157172 end
158173
159174 describe '.exist?' do
You can’t perform that action at this time.
0 commit comments