Sha256: ccb28edd81e5cbb6a88fc90f662e3b483bee296ca412ed6b37e8c3e5fdb1bd07

Contents?: true

Size: 1.12 KB

Versions: 72

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe ActiveAdmin do

  describe "use_asset_pipeline?" do

    before(:each) do
      @orig_rails_version = Rails::VERSION::MINOR
    end

    after(:each) do
      silence_warnings { Rails::VERSION::MINOR = @orig_rails_version }
    end

    it "should be false when using rails 3.0.x" do
      silence_warnings { Rails::VERSION::MINOR = 0 }
      ActiveAdmin.use_asset_pipeline?.should be_false
    end

    context "when rails 3.1.x" do
      before(:each) do
        @orig_rails_app = Rails.application.dup
        silence_warnings { Rails::VERSION::MINOR = 1 }
      end

      after(:each) do
        Rails.application = @orig_rails_app
      end

      it "should be false without asset pipeline enabled" do
        assets = mock(:enabled => false)
        Rails.application.config.stub!(:assets => assets)
        ActiveAdmin.use_asset_pipeline?.should be_false
      end

      it "should be true with asset pipeline enabled" do
        assets = mock(:enabled => true)
        Rails.application.config.stub!(:assets => assets)
        ActiveAdmin.use_asset_pipeline?.should be_true
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 4 rubygems

Version Path
activeadmin-0.6.0 spec/unit/rails_spec.rb
lalala-4.0.0.dev.64 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.63 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.62 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.61 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.60 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.59 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.58 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.57 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.56 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.50 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.46 vendor/deps/active_admin/spec/unit/rails_spec.rb
activeadmin-0.5.1 spec/unit/rails_spec.rb
activeadmin-0.5.0 spec/unit/rails_spec.rb
activeadmin-0.5.0.pre1 spec/unit/rails_spec.rb
activeadmin-0.5.0.pre spec/unit/rails_spec.rb
activeadmin-0.4.4 spec/unit/rails_spec.rb
activeadmin-0.4.3 spec/unit/rails_spec.rb
activeadmin-0.4.2 spec/unit/rails_spec.rb
activeadmin-0.4.1 spec/unit/rails_spec.rb