Sha256: 189489e0a15641d24b152f4bbf7b495314a05ea68886743df6ba5875a9ba6b0b

Contents?: true

Size: 782 Bytes

Versions: 2

Compression:

Stored size: 782 Bytes

Contents

require 'spec_helper'

describe "The jQuery-Rails railtie" do

  it "changes the default javascript expansion" do
    get_js_defaults("default").should == ["jquery.min", "rails"].inspect
  end

  it "uses non-minified js in development" do
    get_js_defaults("default", "development").should == %w(jquery rails).inspect
  end

  it "changes allows overriding the javascript expansion" do
    get_js_defaults("custom").should == ["foo", "bar", "baz"].inspect
  end

  def get_js_defaults(name, env = "production")
    dir = File.expand_path("../../support/#{name}_app", __FILE__)
    Dir.chdir(dir) do
      `bundle install --local`
      `rails runner -e #{env} 'puts Rails.application.config.action_view.
        javascript_expansions[:defaults].inspect'`.chomp
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jquery-rails-0.2.4 spec/lib/jquery-rails_spec.rb
jquery-rails-0.2.3 spec/lib/jquery-rails_spec.rb