Sha256: 0ac419704a5166bd91822c56043163beea10787f492d2c9384889fcc1a419803

Contents?: true

Size: 749 Bytes

Versions: 2

Compression:

Stored size: 749 Bytes

Contents

require 'test_helper'

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

  setup :prepare_destination
  setup :copy_routes

  test "invoke when fixture replacement is given" do
    run_generator
    assert_file "test/fabricators/accounts.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 fabrication --dir custom/fabricators)
    assert_file "custom/fabricators/accounts.rb"
    assert_no_file "test/fixtures/accounts.yml"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails3-generators-0.15.0 test/lib/generators/fabrication/model_generator_test.rb
rails3-generators-0.14.0 test/lib/generators/fabrication/model_generator_test.rb