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.6 spec/unit/rails_spec.rb
activeadmin-0.6.5 spec/unit/rails_spec.rb
activeadmin-0.6.4 spec/unit/rails_spec.rb
activeadmin-0.6.3 spec/unit/rails_spec.rb
activeadmin-0.6.2 spec/unit/rails_spec.rb
activeadmin-0.6.1 spec/unit/rails_spec.rb
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/unit/rails_spec.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/unit/rails_spec.rb