Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not display agent presenter if agent has zero workflow responsibil…
…ities Pulls over a workaround from Sufia: samvera-deprecated/sufia#3080 Needs backporting to 1-7-stable once merged
- Loading branch information
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'spec_helper' | ||
|
||
describe 'curation_concerns/admin/workflow_roles/index.html.erb', type: :view do | ||
let!(:user1) { create(:user) } | ||
let!(:user2) { create(:user) } | ||
let(:presenter) do | ||
CurationConcerns::Admin::WorkflowRolePresenter.new | ||
end | ||
|
||
before do | ||
assign(:presenter, presenter) | ||
allow(view).to receive(:admin_workflow_roles_path).and_return('/admin/workflow_roles') | ||
end | ||
|
||
context 'with no users having workflow roles' do | ||
it 'displays "No Roles" for each user' do | ||
render | ||
expect(rendered).to have_content('No roles', count: 2) | ||
end | ||
end | ||
|
||
context 'with some users having workflow roles' do | ||
before do | ||
# Force user instances to have corresponding sipity agents | ||
user1.to_sipity_agent | ||
user2.to_sipity_agent | ||
end | ||
it 'displays roles for each user' do | ||
render | ||
expect(rendered.match(/<ul>\s+<\/ul>/m)).to be nil | ||
end | ||
end | ||
end |