Sha256: 78e1f9587763bf17d6a5831b19b59f145a3c1f8cc4dcbd8d82561a00db82e584

Contents?: true

Size: 961 Bytes

Versions: 8

Compression:

Stored size: 961 Bytes

Contents

require "spec_helper"

describe Initjs::Generators::InstallGenerator do
  include GeneratorSpec::TestCase
  destination TMP_PATH

  before(:all) do
    copy_file "#{DUMMY_PATH}/app/assets/javascripts/application.sample.js", "#{TMP_PATH}/app/assets/javascripts/application.js"
    run_generator
  end

  it "should inject requires for app file and initjs" do
    destination_root.should have_structure {
      directory 'app/assets/javascripts' do
        file 'application.js' do
          contains '//= require dummy/dummy.js'
          contains '//= require init.js'
        end
      end
    }
  end

  it "should create app file" do
    destination_root.should have_structure {
      directory 'app/assets/javascripts' do
        directory 'dummy' do
          file 'dummy.js.coffee' do
            contains '#= require_self'
            contains '#= require_tree .'
            contains 'window.Dummy ='
          end
        end
      end
    }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
initjs-2.2.0 spec/lib/generators/initjs/install_generator_spec.rb
initjs-2.1.2 spec/lib/generators/initjs/install_generator_spec.rb
initjs-2.1.1 spec/lib/generators/initjs/install_generator_spec.rb
initjs-2.1.0 spec/lib/generators/initjs/install_generator_spec.rb
initjs-2.0.0 spec/lib/generators/initjs/install_generator_spec.rb
initjs-2.0.0.beta1 spec/lib/generators/initjs/install_generator_spec.rb
initjs-1.0.1 spec/dummy/spec/lib/generators/initjs/install_generator_spec.rb
initjs-1.0.0 spec/dummy/spec/lib/generators/initjs/install_generator_spec.rb