diff options
author | Thibaut Girka <thib@sitedethib.com> | 2020-07-01 19:23:14 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-07-01 19:23:14 +0200 |
commit | 45deca65b3fb8e9f19818e3db7d315cab0572d1a (patch) | |
tree | 1b9bab6ec764e8a6600d245595facd5694287e16 /spec/models/concerns | |
parent | 39a0622de70dc24275808cee9526658bd68a55ed (diff) | |
parent | 6d23d40420e4548778f3ca4ed9e8cb16e0eb0073 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `app/javascript/packs/public.js`: Conflict because part of that file has been split to `app/javascript/core/settings.js`. Ported those changes there.
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/remotable_spec.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/spec/models/concerns/remotable_spec.rb b/spec/models/concerns/remotable_spec.rb index 2e6c8a9c6..9cc849ded 100644 --- a/spec/models/concerns/remotable_spec.rb +++ b/spec/models/concerns/remotable_spec.rb @@ -162,19 +162,15 @@ RSpec.describe Remotable do let(:headers) { { 'content-disposition' => file } } it 'assigns file' do - string_io = StringIO.new('') - extname = '.txt' - basename = '0123456789abcdef' + response_with_limit = ResponseWithLimit.new(nil, 0) - allow(SecureRandom).to receive(:hex).and_return(basename) - allow(StringIO).to receive(:new).with(anything).and_return(string_io) + allow(ResponseWithLimit).to receive(:new).with(anything, anything).and_return(response_with_limit) expect(foo).to receive(:public_send).with("download_#{hoge}!", url) foo.hoge_remote_url = url - expect(foo).to receive(:public_send).with("#{hoge}=", string_io) - expect(foo).to receive(:public_send).with("#{hoge}_file_name=", basename + extname) + expect(foo).to receive(:public_send).with("#{hoge}=", response_with_limit) foo.download_hoge!(url) end |