Sha256: 319a29d400bbd6d29ac3a36a5a74284419082af1d30f2467bb04d5754f56c0d9

Contents?: true

Size: 1009 Bytes

Versions: 7

Compression:

Stored size: 1009 Bytes

Contents

require 'test_helper'

class Haml::Generators::ScaffoldGeneratorTest < Rails::Generators::TestCase
  destination File.join(Rails.root)
  tests Rails::Generators::ScaffoldGenerator
  arguments %w(product_line title:string price:integer --template-engine haml)

  setup :prepare_destination
  setup :copy_routes

  test "should invoke template engine" do
    run_generator

    %w(index edit new show _form).each { |view| assert_file "app/views/product_lines/#{view}.html.haml" }
    assert_no_file "app/views/layouts/product_lines.html.haml"
  end

  test "should revoke template engine" do
    run_generator
    run_generator ["product_line"], :behavior => :revoke

    assert_no_file "app/views/product_lines"
    assert_no_file "app/views/layouts/product_lines.html.haml"
  end

  test "should invoke form builder" do
    run_generator %w(product_line title:string price:integer --template-engine haml --form-builder some-form-builder)
    assert_no_file "app/views/product_lines/_form.html.haml"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails3-generators-0.10.3 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.10.2 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.10.1 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.10.0 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.9.2 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.9.1 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.9.0 test/lib/generators/haml/scaffold_generator_test.rb