|
52 | 52 | describe '.compose' do |
53 | 53 | subject(:compose) { service.compose(%w[key1 key2 key3], 'dest_key') } |
54 | 54 |
|
55 | | - let!(:db_file1) { create(:active_storage_db_file, ref: 'key1', data: 'first file') } |
56 | | - let!(:db_file2) { create(:active_storage_db_file, ref: 'key2', data: 'second file') } |
57 | | - let!(:db_file3) { create(:active_storage_db_file, ref: 'key3', data: 'third file') } |
| 55 | + let!(:first_db_file) { create(:active_storage_db_file, ref: 'key1', data: 'first file') } |
| 56 | + let!(:second_db_file) { create(:active_storage_db_file, ref: 'key2', data: 'second file') } |
| 57 | + let!(:third_db_file) { create(:active_storage_db_file, ref: 'key3', data: 'third file') } |
58 | 58 |
|
59 | 59 | it 'composes the source files' do |
60 | 60 | expect { compose }.to change { ActiveStorageDB::File.where(ref: 'dest_key').count }.by(1) |
61 | 61 | expect(compose).to be_a ActiveStorageDB::File |
62 | | - expect(compose.data).to eq [db_file1.data, db_file2.data, db_file3.data].join |
| 62 | + expect(compose.data).to eq [first_db_file.data, second_db_file.data, third_db_file.data].join |
63 | 63 | end |
64 | 64 | end |
65 | 65 | end |
|
70 | 70 | before { upload } |
71 | 71 |
|
72 | 72 | it 'deletes the file' do |
73 | | - expect { delete }.to change { ActiveStorageDB::File.count }.from(1).to(0) |
| 73 | + expect { delete }.to change(ActiveStorageDB::File, :count).from(1).to(0) |
74 | 74 | end |
75 | 75 | end |
76 | 76 |
|
|
80 | 80 | before { upload } |
81 | 81 |
|
82 | 82 | it 'deletes the files' do |
83 | | - expect { delete_prefixed }.to change { ActiveStorageDB::File.count }.from(1).to(0) |
| 83 | + expect { delete_prefixed }.to change(ActiveStorageDB::File, :count).from(1).to(0) |
84 | 84 | end |
85 | 85 | end |
86 | 86 |
|
|
0 commit comments