Sha256: 8d3ee24523c20b4b688e9da12cd8dbe5ac13c8f8e0b67a00c9215a24a1e8bc93

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

require 'test_helper'

class ResourceOverrideTest < Rails::Generators::TestCase
  include GeneratorTestSupport

  tests Rails::Generators::ResourceGenerator
  destination File.join(Rails.root, "tmp")
  setup :prepare_destination, :copy_router, :copy_routes

  test "create template without ember" do
    run_generator ["post"]
    assert_no_file "#{app_path}/templates/posts.hbs"
  end

  test "create template with ember" do
    run_generator ["post", '--ember']
    assert_file "#{app_path}/templates/posts.hbs"
  end

  test "does not create non-essential files for ember apps" do
    run_generator ["post", "title:string"]
    assert_no_file "#{app_path}/assets/javascripts/posts.js"
    assert_no_file "#{app_path}/helpers/posts_helper.rb"
    assert_no_directory "#{app_path}/views/posts"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ember-appkit-rails-0.5.0 test/generators/resource_override_test.rb
ember-appkit-rails-0.4.0 test/generators/resource_override_test.rb