Sha256: 9a82a903f1a955677db9a2617749a82915fe6b48f126ce95550cb4326ab8b05d
Contents?: true
Size: 960 Bytes
Versions: 10
Compression:
Stored size: 960 Bytes
Contents
require "spec_helper" require "support/generators_shared_examples" require "generators/statesman/active_record_transition_generator" describe Statesman::ActiveRecordTransitionGenerator, type: :generator do it_behaves_like "a generator" do let(:migration_name) { 'db/migrate/create_bacon_transitions.rb' } end describe 'properly adds class names' do before { run_generator %w(Yummy::Bacon Yummy::BaconTransition) } subject { file('app/models/yummy/bacon_transition.rb') } it { is_expected.to contain(/:bacon_transition/) } it { is_expected.not_to contain(%r{:yummy/bacon}) } it { is_expected.to contain(/class_name: 'Yummy::Bacon'/) } end describe 'properly formats without class names' do before { run_generator %w(Bacon BaconTransition) } subject { file('app/models/bacon_transition.rb') } it { is_expected.not_to contain(/class_name:/) } it { is_expected.to contain(/class BaconTransition/) } end end
Version data entries
10 entries across 9 versions & 2 rubygems