Sha256: fc3e2319eaeebfd0cf149173b36e95ad691c10ed0d8eda57e4c4c1fd6fb51426

Contents?: true

Size: 1.03 KB

Versions: 41

Compression:

Stored size: 1.03 KB

Contents

require 'test_helper'
require 'lib/generators/haml/testing_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

41 entries across 41 versions & 8 rubygems

Version Path
scaffold-bootstrap3-0.0.2 lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.4 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.3.5 test/lib/generators/haml/scaffold_generator_test.rb
haml-bootstrap-rails-0.3.11 test/lib/generators/haml/scaffold_generator_test.rb
bootstrap-haml-rails-0.4.5 test/lib/generators/haml/scaffold_generator_test.rb
tbh-scaffolds-0.0.4 test/lib/generators/haml/scaffold_generator_test.rb
tbh-scaffolds-0.0.3 test/lib/generators/haml/scaffold_generator_test.rb
tbh-scaffolds-0.0.2 test/lib/generators/haml/scaffold_generator_test.rb
tbh-scaffolds-0.0.1 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-with-i18n-0.1.3 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-with-i18n-0.1.2 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-with-i18n-0.1.1 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-with-i18n-0.1.0 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.3.4 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.3.3 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.3.2 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.3.1 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.3 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.12.1 test/lib/generators/haml/scaffold_generator_test.rb
rails3-generators-0.12.0 test/lib/generators/haml/scaffold_generator_test.rb