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

Version Path
curation_concerns-1.7.8 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.7 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-2.0.0 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-2.0.0.rc2 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.6 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.5 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.4 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.3 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.2 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-2.0.0.rc1 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.1 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.0 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb
curation_concerns-1.7.0.beta1 spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb