Skip to content

Commit

Permalink
🧹 Favor Sipity::Entity function over to_sipity_entity
Browse files Browse the repository at this point in the history
The Sipity conversion methods are now explicit functions (much like the
`Array()` function).

- https://github.com/samvera/hyrax/blob/5aaa568d348a180add2a1337d9d794b740703df8/app/models/sipity.rb#L20
  • Loading branch information
jeremyf committed Dec 19, 2023
1 parent c786fb8 commit d758340
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 d758340

Please sign in to comment.