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