|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -RSpec.describe 'ActiveStorageDB tasks' do # rubocop:disable RSpec/DescribeClass |
| 3 | +RSpec.describe 'ActiveStorageDB tasks' do |
4 | 4 | include_context 'with rake tasks' |
5 | 5 |
|
6 | 6 | describe 'asdb:list' do |
|
22 | 22 | end |
23 | 23 |
|
24 | 24 | describe 'asdb:get' do |
25 | | - subject(:task) { execute_task('asdb:get', options) } |
26 | | - |
27 | | - let(:options) {} |
| 25 | + subject(:task) { execute_task('asdb:get') } |
28 | 26 |
|
29 | 27 | it 'exits showing the required arguments' do |
30 | 28 | with_captured_stderr do |
|
33 | 31 | end |
34 | 32 |
|
35 | 33 | context 'with only the source specified' do |
36 | | - let(:options) { { src: 'some_file' } } |
| 34 | + subject(:task) { execute_task('asdb:get', src: 'some_file') } |
37 | 35 |
|
38 | 36 | it 'exits showing the required arguments' do |
39 | 37 | with_captured_stderr do |
|
43 | 41 | end |
44 | 42 |
|
45 | 43 | context 'with an invalid destination' do |
46 | | - let(:options) { { src: 'some_file', dst: 'some_path' } } |
| 44 | + subject(:task) { execute_task('asdb:get', src: 'some_file', dst: 'some_path') } |
47 | 45 |
|
48 | 46 | before do |
49 | 47 | allow(File).to receive(:writable?).and_return(false) |
|
57 | 55 | end |
58 | 56 |
|
59 | 57 | context 'with a missing source' do |
60 | | - let(:options) { { src: 'some_file', dst: 'some_path' } } |
| 58 | + subject(:task) { execute_task('asdb:get', src: 'some_file', dst: 'some_path') } |
61 | 59 |
|
62 | 60 | before do |
63 | 61 | allow(File).to receive(:writable?).and_return(true) |
|
71 | 69 | end |
72 | 70 |
|
73 | 71 | context 'with valid arguments' do |
| 72 | + subject(:task) { execute_task('asdb:get', src: blob.filename.to_s, dst: 'some_path') } |
| 73 | + |
74 | 74 | let(:blob) { build_stubbed(:active_storage_blob) } |
75 | 75 | let(:blobs) { instance_double(ActiveRecord::Relation) } |
76 | | - let(:options) { { src: blob.filename.to_s, dst: 'some_path' } } |
77 | 76 |
|
78 | 77 | before do |
79 | 78 | allow(File).to receive_messages(binwrite: 1000, writable?: true) |
|
0 commit comments