Skip to content

Commit

Permalink
Merge pull request #2077 from samvera/fix-conversion-to-sipity
Browse files Browse the repository at this point in the history
🧹 Favor Sipity::Entity function over to_sipity_entity
  • Loading branch information
jeremyf authored Dec 19, 2023
2 parents a9dc46e + d758340 commit b01e6c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/requests/work_approval_permissions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
end

it 'can approve a work' do
expect(work.to_sipity_entity.workflow_state.name).to eq('pending_review')
expect(Sipity::Entity(work).workflow_state.name).to eq('pending_review')

put hyrax_workflow_action_path(work), params: { workflow_action: { name: 'approve', comment: '' } }

expect(work.to_sipity_entity.reload.workflow_state.name).to eq('deposited')
expect(Sipity::Entity(work).reload.workflow_state.name).to eq('deposited')
end

it 'can see works submitted for review in the dashboard' do
Expand All @@ -59,11 +59,11 @@
end

it 'can approve a work' do
expect(work.to_sipity_entity.workflow_state.name).to eq('pending_review')
expect(Sipity::Entity(work).workflow_state.name).to eq('pending_review')

put hyrax_workflow_action_path(work), params: { workflow_action: { name: 'approve', comment: '' } }

expect(work.to_sipity_entity.reload.workflow_state.name).to eq('deposited')
expect(Sipity::Entity(work).reload.workflow_state.name).to eq('deposited')
end

it 'can see works submitted for review in the dashboard' do
Expand All @@ -79,12 +79,12 @@
end

it 'cannot approve a work' do
expect(work.to_sipity_entity.workflow_state.name).to eq('pending_review')
expect(Sipity::Entity(work).workflow_state.name).to eq('pending_review')

put hyrax_workflow_action_path(work), params: { workflow_action: { name: 'approve', comment: '' } }

expect(response).to have_http_status(:unauthorized)
expect(work.to_sipity_entity.reload.workflow_state.name).to eq('pending_review')
expect(Sipity::Entity(work).reload.workflow_state.name).to eq('pending_review')
end

it 'cannot see works submitted for review in the dashboard' do
Expand All @@ -96,12 +96,12 @@

context 'when signed in as a user with no special access' do
it 'cannot approve a work' do
expect(work.to_sipity_entity.workflow_state.name).to eq('pending_review')
expect(Sipity::Entity(work).workflow_state.name).to eq('pending_review')

put hyrax_workflow_action_path(work), params: { workflow_action: { name: 'approve', comment: '' } }

expect(response).to have_http_status(:unauthorized)
expect(work.to_sipity_entity.reload.workflow_state.name).to eq('pending_review')
expect(Sipity::Entity(work).reload.workflow_state.name).to eq('pending_review')
end

it 'cannot see works submitted for review in the dashboard' do
Expand Down

0 comments on commit b01e6c5

Please sign in to comment.