Sha256: 46a70ad42549d24bed4396dc7dd66d99ce09a19b79d332996e399045162661b9

Contents?: true

Size: 1.49 KB

Versions: 13

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'

RSpec.describe "Manage workflow roles", type: :feature do
  let(:user) { create(:user) }
  let(:one_step_workflow) do
    {
      workflows: [
        {
          name: "one_step",
          label: "One-step mediated deposit workflow",
          description: "A single-step workflow for mediated deposit",
          actions: [
            {
              name: "deposit",
              from_states: [],
              transition_to: "pending_review"
            },
            {
              name: "approve",
              from_states: [
                {
                  names: ["pending_review"],
                  roles: ["approving"]
                }
              ],
              transition_to: "complete",
              methods: [
                "CurationConcerns::Workflow::ActivateObject"
              ]
            }
          ]
        }
      ]
    }
  end
  before do
    allow_any_instance_of(CurationConcerns::Admin::WorkflowRolesController).to receive(:authorize!).with(:read, :admin_dashboard).and_return(true)
    CurationConcerns::Workflow::WorkflowImporter.new(data: one_step_workflow.as_json).call
    CurationConcerns::Workflow::PermissionGenerator.call(roles: Sipity::Role.all,
                                                         workflow: Sipity::Workflow.last,
                                                         agents: user)
  end

  it "shows the roles" do
    visit '/admin/workflow_roles'
    expect(page).to have_content 'one_step - approving'
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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