Sha256: 783f8cd03cda9a1be395b7878d2f6574c39030c782d0c2d03744d8a535feab1b
Contents?: true
Size: 722 Bytes
Versions: 13
Compression:
Stored size: 722 Bytes
Contents
require 'spec_helper' RSpec.describe CurationConcerns::Admin::WorkflowRolesController, :no_clean do routes { CurationConcerns::Engine.routes } describe "#get" do context "when you have permission" do before do allow(controller).to receive(:authorize!).with(:read, :admin_dashboard).and_return(true) end it "works" do get :index expect(response).to be_success expect(assigns[:presenter]).to be_kind_of CurationConcerns::Admin::WorkflowRolePresenter end end context "when they don't have permission" do it "throws a CanCan error" do get :index expect(response).to redirect_to new_user_session_path end end end end
Version data entries
13 entries across 13 versions & 1 rubygems