Sha256: 111c3ed729f7f124a769ce161367d1be9c710da8fb54b423db29feb70890e706
Contents?: true
Size: 1.07 KB
Versions: 23
Compression:
Stored size: 1.07 KB
Contents
require "spec_helper" RSpec.describe 'PowerConverter', :no_clean do context '#convert_to_sipity_action_name' do [ [:show, 'show'], [:show?, 'show'], [:new?, 'new'], [:new, 'new'], [:edit?, 'edit'], [:edit, 'edit'], [:submit, 'submit'], [:submit?, 'submit'], [:attach, 'attach'], [Sipity::WorkflowAction.new(name: 'hello'), 'hello'] ].each_with_index do |(original, expected), index| it "will convert #{original.inspect} to #{expected.inspect} (scenario ##{index})" do expect(PowerConverter.convert_to_sipity_action_name(original)).to eq(expected) end end it 'will raise an exception if it is not processible' do object = double('Bad Wolf') expect { PowerConverter.convert_to_sipity_action_name(object) }.to raise_error(PowerConverter::ConversionError) end it 'will leverage a short-circuit #to_processing_action_name' do object = double(to_sipity_action_name: 'bob') expect(PowerConverter.convert_to_sipity_action_name(object)).to eq('bob') end end end
Version data entries
23 entries across 23 versions & 3 rubygems