Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabifija committed Oct 10, 2018
1 parent d96da20 commit 95e6f9c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions spec/filestack/ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def initialize(body_content, error_number = 200)
def code
@code
end

def body
@body
end
end


Expand Down Expand Up @@ -261,12 +265,16 @@ def code
end

it 'Multipart upload returns the correct response' do
allow(MultipartUploadUtils).to receive(:multipart_upload)
.and_return(@response)
allow_any_instance_of(MultipartUploadUtils).to receive(:multipart_start)
.and_return(@start_response)
allow_any_instance_of(MultipartUploadUtils).to receive(:run_uploads)
.and_return(['somepartsandetags'])
allow_any_instance_of(MultipartUploadUtils).to receive(:multipart_complete)
.and_return(GeneralResponse.new(@start_response))
response = MultipartUploadUtils.multipart_upload(
@test_apikey, @test_filepath
@test_apikey, @test_filepath, nil, nil, 60, intelligent: false
)
expect(response.body).to eq(@response.body)
expect(response.to_json).to eq(@response.body)
end

it 'runs multipart uploads' do
Expand Down

0 comments on commit 95e6f9c

Please sign in to comment.