Skip to content

Commit 776314f

Browse files
committed
Add a spec verify that a DB entity is created for blobs
This is useful also to ensure that the dummy app is using the environment option `config.active_storage.service = :db`
1 parent f08da4f commit 776314f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spec/requests/file_controller_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def create_blob_before_direct_upload(filename: 'hello.txt', byte_size:, checksum
1515

1616
before { allow(ActiveStorage::Current).to receive(:host).and_return(host) }
1717

18+
it 'creates a new File entity in the DB' do
19+
expect { create_blob }.to change(ActiveStorageDB::File, :count).from(0).to(1)
20+
end
21+
1822
describe '.show' do
1923
it 'returns the blob as inline' do
2024
get blob.service_url

0 commit comments

Comments
 (0)