Sha256: 115d6c42201c81512cab691213e6b2865eebf4eec4e33cfecd74557fe1918b4b

Contents?: true

Size: 1012 Bytes

Versions: 2

Compression:

Stored size: 1012 Bytes

Contents

require 'test_helper'

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

  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.erb" }
    assert_no_file "app/views/layouts/product_lines.html.erb"
  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.erb"
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap-generators-0.0.3 test/lib/generators/erubis/scaffold_generator_test.rb
bootstrap-generators-0.0.2 test/lib/generators/erubis/scaffold_generator_test.rb