Sha256: bed95282c1efd61de347a6927a0aa43ba407189a54ace7321bc81f16c7d478d5
Contents?: true
Size: 830 Bytes
Versions: 6
Compression:
Stored size: 830 Bytes
Contents
require 'spec_helper' RSpec.describe 'PowerConverter', no_clean: true do context 'sipity_workflow_state' do let(:workflow_state) { Sipity::WorkflowState.new(id: 1, name: 'hello') } let(:workflow) { create(:workflow) } it 'will convert a Sipity::WorkflowState' do expect(PowerConverter.convert(workflow_state, to: :sipity_workflow_state)).to eq(workflow_state) end it 'will convert a string based on scope' do create(:workflow_state, workflow_id: workflow.id, name: 'hello') PowerConverter.convert('hello', scope: workflow, to: :sipity_workflow_state) end it 'will attempt convert a string based on scope' do expect { PowerConverter.convert('missing', scope: workflow, to: :sipity_workflow_state) } .to raise_error(PowerConverter::ConversionError) end end end
Version data entries
6 entries across 6 versions & 1 rubygems