Sha256: ced948c59e85541ae071880cd430a4b79cbb4235128540074a4e2420e7649960

Contents?: true

Size: 1.2 KB

Versions: 35

Compression:

Stored size: 1.2 KB

Contents

require File.join(File.dirname(__FILE__), '..', 'test_helper')


class ShouldaModelGeneratorTest < GeneratorTestCase
  context "running the default generator" do
    setup do
      run_generator('shoulda_model', %w(Product name:string supplier_id:integer created_at:timestamp))
    end
    
    should_generate_model :product
    should_generate_factory :product
    should_generate_unit_test :product
    should_generate_migration :create_products
    
    should "generate migration" do
      assert_generated_migration :create_products do |t|
        assert_generated_column t, :name, :string
        assert_generated_column t, :supplier_id, :integer
        assert_generated_column t, :created_at, :timestamp
      end
    end
  end
  
  context "running the generator, when skipping factory and migration" do
    setup do
      run_generator('shoulda_model', %w(Product name:string supplier_id:integer created_at:timestamp --skip-factory))
    end
    
    should_generate_model :product
    should_not_generate_factory :product
    should_generate_unit_test :product
    should_generate_migration :create_products
    
    should "not generate migration" do
      assert_skipped_migration :create_products
    end
  end
  
end

Version data entries

35 entries across 35 versions & 11 rubygems

Version Path
coreymartella-dmd_generator-0.2.3 test/rails_generators/dmd_model_generator_test.rb
drd-shoulda_generator-0.2.1 test/rails_generators/shoulda_model_generator_test.rb
martijn-shoulda_generator-0.2.1 test/rails_generators/shoulda_model_generator_test.rb
martijn-shoulda_generator-0.2.2 test/rails_generators/shoulda_model_generator_test.rb
mattyoho-shoulda_generator-0.2.1 test/rails_generators/shoulda_model_generator_test.rb
sob-shoulda_generator-0.2.1 test/rails_generators/shoulda_model_generator_test.rb
stefanpenner-shoulda_generator-0.2.0 test/rails_generators/shoulda_model_generator_test.rb
stefanpenner-shoulda_generator-0.2.1 test/rails_generators/shoulda_model_generator_test.rb
stefanpenner-shoulda_generator-0.2.2 test/rails_generators/shoulda_model_generator_test.rb
technicalpickles-shoulda_generator-0.2.0 test/rails_generators/shoulda_model_generator_test.rb
technicalpickles-shoulda_generator-0.2.1 test/rails_generators/shoulda_model_generator_test.rb
shoulda_machinist_generator-0.4.4 test/rails_generators/shoulda_model_generator_test.rb
shoulda_machinist_generator-0.4.3 test/rails_generators/shoulda_model_generator_test.rb
shoulda_machinist_generator-0.4.2 test/rails_generators/shoulda_model_generator_test.rb
shoulda_machinist_generator-0.4.1 test/rails_generators/shoulda_model_generator_test.rb
shoulda_machinist_generator-0.4.0 test/rails_generators/shoulda_model_generator_test.rb
starter-template_generator-0.0.2 test/rails_generators/shoulda_model_generator_test.rb
i18n_shoulda_generator-1.0.1 test/rails_generators/shoulda_model_generator_test.rb
shoulda_generator-1.3.5 test/rails_generators/shoulda_model_generator_test.rb
shoulda_generator-0.2.2 test/rails_generators/shoulda_model_generator_test.rb