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
haml-rails-2.0.1 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-2.0.0 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-1.0.0 test/lib/generators/haml/scaffold_generator_test.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/haml-rails-0.9.0/test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.9.0 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.8.2 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.8.1 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.8.0 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.7.0 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.6.0 test/lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-1.0.1 lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-1.0.0 lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-0.0.9 lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-0.0.8 lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.5.3 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.5.2 test/lib/generators/haml/scaffold_generator_test.rb
haml-rails-0.5.1 test/lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-0.0.6 lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-0.0.5 lib/generators/haml/scaffold_generator_test.rb
scaffold-bootstrap3-0.0.4 lib/generators/haml/scaffold_generator_test.rb