Sha256: 52728b418b1e4a9311fa8d21ac0fb0c0bfbf31f31ce0b2ef50cd836e0eb1d644

Contents?: true

Size: 1.36 KB

Versions: 59

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper' 

module MockRegistration
  extend ActiveAdmin::AssetRegistration
end

describe ActiveAdmin::AssetRegistration do

  before do
    MockRegistration.clear_stylesheets!
    MockRegistration.clear_javascripts!
  end

  it "should register a stylesheet file" do
    MockRegistration.register_stylesheet "active_admin.css"
    MockRegistration.stylesheets.length.should == 1
    MockRegistration.stylesheets.first.path.should == "active_admin.css"
  end

  it "should clear all existing stylesheets" do
    MockRegistration.register_stylesheet "active_admin.css"
    MockRegistration.stylesheets.length.should == 1
    MockRegistration.clear_stylesheets!
    MockRegistration.stylesheets.length.should == 0
  end
  
  it "should allow media option when registering stylesheet" do
    MockRegistration.register_stylesheet "active_admin.css", :media => :print
    MockRegistration.stylesheets.first.options[:media].should == :print
  end

  it "should register a javascript file" do
    MockRegistration.register_javascript "active_admin.js"
    MockRegistration.javascripts.should == ["active_admin.js"]
  end

  it "should clear all existing javascripts" do
    MockRegistration.register_javascript "active_admin.js"
    MockRegistration.javascripts.should == ["active_admin.js"]    
    MockRegistration.clear_javascripts!
    MockRegistration.javascripts.should == []
  end
end

Version data entries

59 entries across 59 versions & 3 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/spec/unit/asset_registration_spec.rb