Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 Favor Sipity::Entity function over to_sipity_entity #2077

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading