Sha256: d6115d5faf2845185a3fe32fc34e9986e9d5909d207c255231d667a3ad3c7ea7

Contents?: true

Size: 925 Bytes

Versions: 1

Compression:

Stored size: 925 Bytes

Contents

require 'spec/test/unit'
require 'spec_helper'
require 'generators/jquery/install/install_generator'

class Jquery::Generators::InstallGeneratorTest < Rails::Generators::TestCase
  describe "The jQuery generator"

  destination File.join(Rails.root)
  tests Jquery::Generators::InstallGenerator
  arguments []

  setup :prepare_destination

  it "should install jquery" do
    run_generator

    %w(jquery.min.js jquery.js rails.js).each { |js| assert_file "public/javascripts/#{js}" }
    %w(controls.js dragdrop.js effects.js prototype.js).each { |js| assert_no_file "public/javascripts/#{js}" }
  end

  it "should install jquery-ui when asked" do
    run_generator %w(--ui)

    %w(jquery.min.js jquery.js jquery-ui.min.js jquery-ui.js rails.js).each { |js| assert_file "public/javascripts/#{js}" }
    %w(controls.js dragdrop.js effects.js prototype.js).each { |js| assert_no_file "public/javascripts/#{js}" }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jquery-rails-0.2.3 spec/lib/generators/jquery/install_generator_spec.rb