This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2907: allow depositor to be passed in to api params (#490)
* if depositor key is in API side params, sign in the depositor (but raise exception if not found) after successful API user authentication, otherwise just sign in API user.
- Loading branch information
1 parent
34ef683
commit 1676cf1
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
require 'rails_helper' | ||
|
||
describe Lakeshore::FileSetsController do | ||
let(:apiuser) { create(:apiuser) } | ||
before do | ||
sign_in_basic(apiuser) | ||
LakeshoreTesting.restore | ||
end | ||
|
||
let(:asset) { create(:asset, :with_intermediate_file_set) } | ||
let(:file_set1) { asset.intermediate_file_set.first } | ||
let(:file) { create(:image_file) } | ||
let(:aic_user1) { create(:aic_user1) } | ||
|
||
describe "#update" do | ||
before { put :update, params } | ||
context "when API user exists" do | ||
context "but is not an AICUser and no depositor param exists" do | ||
let(:file_set_params) { { files: [file] } } | ||
let(:params) { { file_set: file_set_params, id: file_set1.id } } | ||
it "returns a 500 respone code with an error message" do | ||
expect(response).to have_http_status(500) | ||
expect(response.body).to include("AICUser 'apiuser' not found, contact [email protected]\n") | ||
end | ||
end | ||
end | ||
end | ||
end |