Sha256: 844263d1506da5dcc58bfc53df91c89e3cb27f9de07b2f584ee8339ff9e83200

Contents?: true

Size: 828 Bytes

Versions: 5

Compression:

Stored size: 828 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)

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slim-rails-0.2.1 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-0.2.0 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-0.1.2 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-0.1.1 test/lib/generators/slim/scaffold_generator_test.rb
slim-rails-0.1.0 test/lib/generators/slim/scaffold_generator_test.rb