diff options
author | Starfall <us@starfall.systems> | 2020-07-01 16:04:26 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2020-07-01 16:04:26 -0500 |
commit | 9b8ab85007cc9b527ba8c59a3624731cd8e46ffe (patch) | |
tree | 28cf79b4c73ec6d328136ea04a63321862096e5a /spec/models | |
parent | 6ec1f4c99e51a13ca56d639b85168dfb874daf75 (diff) | |
parent | 665eb1affe7ba765af476e6f00096aad3af70735 (diff) |
Merge branch 'glitch' into main
Diffstat (limited to 'spec/models')
-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 |