Sha256: db6d5f9077329be78abd2b9296034338a68e4f59eb34137287f5e5dc65795a44

Contents?: true

Size: 842 Bytes

Versions: 5

Compression:

Stored size: 842 Bytes

Contents

require 'test_helper'

class Machinist::Generators::ModelGeneratorTest < Rails::Generators::TestCase
  destination File.join(Rails.root)
  tests Rails::Generators::ModelGenerator
  arguments %w(Account name:string age:integer -r machinist)

  setup :prepare_destination
  setup :copy_routes

  test "invoke when fixture replacement is given" do
    run_generator
    assert_file "test/blueprints/accounts.rb"
    assert_file "config/initializers/machinist.rb"
    assert_no_file "test/fixtures/accounts.yml"
  end

  test "invoke when fixture replacement is given with custom dir" do
    content = run_generator %w(Account name:string age:integer -r machinist --dir custom/blueprints)
    assert_file "custom/blueprints/accounts.rb"
    assert_file "config/initializers/machinist.rb"
    assert_no_file "test/fixtures/accounts.yml"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails3-generators-0.10.1 test/lib/generators/machinist/model_generator_test.rb
rails3-generators-0.10.0 test/lib/generators/machinist/model_generator_test.rb
rails3-generators-0.9.2 test/lib/generators/machinist/model_generator_test.rb
rails3-generators-0.9.1 test/lib/generators/machinist/model_generator_test.rb
rails3-generators-0.9.0 test/lib/generators/machinist/model_generator_test.rb