Sha256: baf95f86673d2a062e7d1c3b7eb8a616851f18281d85c7b6b2ca07b7b66cd374

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

require 'test_helper'
require 'ember/appkit/rails/resource_override'

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

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

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

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

  private

  def copy_routes
    routes = File.expand_path("../../dummy/config/routes.rb", __FILE__)
    destination = File.expand_path('../../dummy/tmp/config', __FILE__)
    FileUtils.mkdir_p(destination)
    FileUtils.cp routes, destination
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ember-appkit-rails-0.2.2 test/generators/resource_override_test.rb
ember-appkit-rails-0.2.1 test/generators/resource_override_test.rb
ember-appkit-rails-0.2.0 test/generators/resource_override_test.rb