Sha256: b9ccdf2d8b5117847ffc373495ebf573825c82879669a3fde058c52b6acc2cc4

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

require "spec_helper"
require "support/generators_shared_examples"
require "generators/statesman/mongoid_transition_generator"

describe Statesman::MongoidTransitionGenerator, type: :generator do
  describe 'the model contains the correct words' do
    before { run_generator %w(Yummy::Bacon Yummy::BaconTransition) }
    subject { file('app/models/yummy/bacon_transition.rb') }

    it { is_expected.not_to contain(/:yummy\/bacon/) }
    it { is_expected.to contain(/class_name: 'Yummy::Bacon'/) }
  end

  describe 'the model contains the correct words' 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.not_to contain(/CreateYummy::Bacon/) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
statesman-1.2.2 spec/generators/statesman/mongoid_transition_generator_spec.rb
statesman-1.2.1 spec/generators/statesman/mongoid_transition_generator_spec.rb
statesman-1.2.0 spec/generators/statesman/mongoid_transition_generator_spec.rb