Sha256: 80c1cf7188c8802097fda0e5ccc1f1ba261d4f6d514c76ddeb3ae45a2a417ce1

Contents?: true

Size: 954 Bytes

Versions: 4

Compression:

Stored size: 954 Bytes

Contents

# frozen_string_literal: true

RSpec.describe TwilioBase::TaskRouter::Workflow do
  let(:attributes) do
    {
      configuration: {},
      friendly_name: 'Test Workspace'
    }
  end

  describe '#create' do
    it 'should create a new workflow' do
      workspace = TwilioBase::Fake::TaskRouter::Workspace.new.create({})
      expect do
        described_class.create(
          attributes: attributes,
          workspace: workspace
        )
      end.to change {
        TwilioBase::Fake::TaskRouter::Workflow.workflows.count
      }.by(1)
    end

    it 'assigns the config to the workflow' do
      workspace = TwilioBase::Fake::TaskRouter::Workspace.new.create({})

      described_class.create(
        attributes: attributes,
        workspace: workspace
      )

      workflow_name = TwilioBase::Fake::TaskRouter::Workflow
        .workflows.last.friendly_name
      expect(workflow_name).to eq attributes[:friendly_name]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twilio_base-1.11.1101 spec/services/twilio_base/task_router/workflow_spec.rb
twilio_base-1.11.11 spec/services/twilio_base/task_router/workflow_spec.rb
twilio_base-1.9.0 spec/services/twilio_base/task_router/workflow_spec.rb
twilio_base-1.8.0 spec/services/twilio_base/task_router/workflow_spec.rb