Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/test/fake_s3_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def show
end
end

def create
def update
key = params[:key]

self.class.data[key] = request.body.read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const withBackgroundEncryptedUpload = (Component) => ({ onChange, ...props }) =>
)
.then((encryptedValue) =>
window.fetch(url, {
method: 'POST',
method: 'PUT',
body: encryptedValue,
headers: { 'Content-Type': 'application/octet-stream' },
}),
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
delete '/telephony' => 'telephony#destroy'

get '/s3/:key' => 'fake_s3#show', as: :fake_s3
post '/s3/:key' => 'fake_s3#create'
put '/s3/:key' => 'fake_s3#update'
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/fake_s3_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
end
end

describe '#create' do
describe '#update' do
subject(:action) do
post :create, body: data, params: { key: key }
post :update, body: data, params: { key: key }
end

it 'stores the data in memory' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('document-capture/higher-order/with-background-encrypted-upload', () =>
expect(await patch.foo_image_url).to.equal('about:blank');
const [url, params] = window.fetch.getCall(0).args;
expect(url).to.equal('about:blank');
expect(params.method).to.equal('POST');
expect(params.method).to.equal('PUT');
expect(params.body).to.be.instanceOf(ArrayBuffer);
const bodyAsString = String.fromCharCode.apply(null, new Uint8Array(params.body));
expect(bodyAsString).to.not.equal('bar');
Expand Down