Sha256: 8eff0ca8ffbb7f55797a56fbe9ad157927c8132c959725fa0f03a6f5b2c1efcd

Contents?: true

Size: 948 Bytes

Versions: 11

Compression:

Stored size: 948 Bytes

Contents

require 'test_helper'
require 'lib/generators/slim/testing_helper'

class Slim::Generators::ScaffoldGeneratorTest < Rails::Generators::TestCase
  destination File.join(Rails.root)
  tests Rails::Generators::ScaffoldGenerator
  arguments %w(product_line title:string price:integer --template-engine slim --orm active-record)

  setup :prepare_destination
  setup :copy_routes

  test "should invoke template engine" do
    run_generator

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

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

    assert_no_file File.join "app", "views", "product_lines"
    assert_no_file File.join "app", "views", "layouts", "product_lines.html.slim"
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
slim-rails-3.0.0 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.1.5 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.1.4 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.1.3 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.1.2 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.1.1 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.1.0 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.0.4 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.0.3 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.0.2 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-2.0.1 test/lib/generators/slim/scaffold_generator_test.rb