Sha256: 44363363fddcd66f8806041bd2731e6cb01f819f1b222ae358a5bd8f865e3112

Contents?: true

Size: 1.07 KB

Versions: 32

Compression:

Stored size: 1.07 KB

Contents

describe 'spotlight/roles/index', type: :view do
  let(:user) { stub_model(Spotlight::Engine.user_class, email: 'jane@example.com') }
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:admin_role) { FactoryGirl.create(:role, role: 'admin', user: user, resource: exhibit) }
  let(:roles) { [admin_role] }

  before do
    assign(:exhibit, exhibit)
    allow(view).to receive(:current_exhibit).and_return(exhibit)
    allow(exhibit).to receive(:roles).and_return roles
  end

  it 'renders the index page form' do
    render

    action = spotlight.update_all_exhibit_roles_path(exhibit)
    assert_select "form[action='#{action}'][method='post']" do
      assert_select "tr[data-show-for='#{admin_role.id}']"
      assert_select "tr[data-edit-for='#{admin_role.id}']"
      assert_select "input[type='submit'][data-behavior='destroy-user'][data-target='#{admin_role.id}']"
      assert_select "input[type='hidden'][data-destroy-for='#{admin_role.id}']"
      assert_select "a[data-behavior='cancel-edit']"
      assert_select "input[type='submit'][value='Save changes']"
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.34.1 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.34.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.33.3 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.33.2 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.33.1 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.33.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.32.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.31.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.30.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.29.1 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.29.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.28.3 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.28.2 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.28.1 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.28.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.27.0 spec/views/spotlight/roles/index.html.erb_spec.rb
blacklight-spotlight-0.26.1 spec/views/spotlight/roles/index.html.erb_spec.rb