Sha256: db25f9961aedde7ac75cb3e4c11054796928ca7084c3e810422840a7333839ee

Contents?: true

Size: 945 Bytes

Versions: 6

Compression:

Stored size: 945 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

6 entries across 6 versions & 1 rubygems

Version Path
slim-rails-3.2.0 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-3.1.3 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-3.1.2 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-3.1.1 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-3.1.0 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-3.0.1 test/lib/generators/slim/scaffold_generator_test.rb