Skip to content

Commit

Permalink
Remove tests that have a setup that is not possible in SDR
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Nov 9, 2023
1 parent c619069 commit 91f4fe1
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions spec/requests/iiif_auth_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,72 +113,5 @@
end
end
end

context 'with an item that is stanford-only or viewable in a location' do
before do
stub_rights_xml <<-XML
<publicObject>
<rightsMetadata>
<access type="read">
<machine>
<group>Stanford</group>
</machine>
<machine>
<location>location1</location>
</machine>
</access>
</rightsMetadata>
</publicObject>
XML
end

context 'with a user in the location' do
let(:current_user) { user_loc_no_webauth }

it 'works' do
get "/image/iiif/#{identifier}/#{region}/#{size}/#{rotation}/#{quality}.#{format}"
expect(response).to have_http_status(:ok)
expect(response.media_type).to eq('image/jpeg')
end
end

context 'with an unauthorized user outside the location' do
let(:current_user) { user_webauth_no_stanford_no_loc }

it 'blocks' do
get "/image/iiif/#{identifier}/#{region}/#{size}/#{rotation}/#{quality}.#{format}"
expect(response).to have_http_status(:forbidden)
end
end

context 'with a stanford authenticated user' do
let(:current_user) { user_webauth_stanford_no_loc }

it 'works' do
get "/image/iiif/#{identifier}/#{region}/#{size}/#{rotation}/#{quality}.#{format}"
expect(response).to have_http_status(:ok)
expect(response.media_type).to eq('image/jpeg')
end
end

context 'with a stanford authenticated user in the location' do
let(:current_user) { user_webauth_stanford_loc }

it 'works' do
get "/image/iiif/#{identifier}/#{region}/#{size}/#{rotation}/#{quality}.#{format}"
expect(response).to have_http_status(:ok)
expect(response.media_type).to eq('image/jpeg')
end
end

context 'with an unauthenticated user not in the location' do
let(:current_user) { user_no_loc_no_webauth }

it 'redirects to the authentication endpoint' do
get "/image/iiif/#{identifier}/#{region}/#{size}/#{rotation}/#{quality}.#{format}"
expect(response).to redirect_to(auth_iiif_url(id: 'nr349ct7889', file_name: 'nr349ct7889_00_0001', format:))
end
end
end
end
end

0 comments on commit 91f4fe1

Please sign in to comment.