Skip to content

Commit

Permalink
Fix incorrect use of block with raise_error
Browse files Browse the repository at this point in the history
This was causing any raised error to be considered a pass, which is clearly not the intent.

Fixing this revealed a problem caused by using Valkyrie::Resource directly. Required attributes
were missing because they are only defined when the Valkyrie::Resource is inherited.
  • Loading branch information
dlpierce committed Oct 25, 2024
1 parent b59887d commit 2265337
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

describe '#find_access_control' do
context 'for missing object' do
let(:resource) { Valkyrie::Resource.new }
let(:resource) { Hyrax::Resource.new }

it 'raises ObjectNotFoundError' do
expect { query_handler.find_access_control_for(resource: resource) }
.to raise_error { Valkyrie::Persistence::ObjectNotFoundError }
.to raise_error Valkyrie::Persistence::ObjectNotFoundError
end
end

Expand Down Expand Up @@ -50,7 +50,7 @@

it 'raises ObjectNotFoundError' do
expect { query_handler.find_access_control_for(resource: resource) }
.to raise_error { Valkyrie::Persistence::ObjectNotFoundError }
.to raise_error Valkyrie::Persistence::ObjectNotFoundError
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

it 'raises ObjectNotFoundError' do
expect { query_handler.find_access_control_for(resource: resource) }
.to raise_error { Valkyrie::Persistence::ObjectNotFoundError }
.to raise_error Valkyrie::Persistence::ObjectNotFoundError
end
end

Expand Down

0 comments on commit 2265337

Please sign in to comment.