Sha256: 115e24bfed9f9735cfb9f0d3b1445c4aa0117a8a035778b9b12a6944d383c299

Contents?: true

Size: 908 Bytes

Versions: 4

Compression:

Stored size: 908 Bytes

Contents

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb
curation_concerns-1.7.7 spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb
curation_concerns-1.7.6 spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb
curation_concerns-1.7.5 spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb