Sha256: ce906a48b5e9674df1d4b016c642a0bc8b515bdd4f4c8e93162d375b627fd332

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 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.should == ["active_admin.css"]
  end

  it "should clear all existing stylesheets" do
    MockRegistration.register_stylesheet "active_admin.css"
    MockRegistration.stylesheets.should == ["active_admin.css"]    
    MockRegistration.clear_stylesheets!
    MockRegistration.stylesheets.should == []
  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

10 entries across 10 versions & 4 rubygems

Version Path
andrewroth_activeadmin-0.3.4 spec/unit/asset_registration_spec.rb
activeadmin-0.3.4 spec/unit/asset_registration_spec.rb
activeadmin-0.3.3 spec/unit/asset_registration_spec.rb
activeadmin-0.3.2 spec/unit/asset_registration_spec.rb
activeadmin-0.3.1 spec/unit/asset_registration_spec.rb
activeadmin-0.3.0 spec/unit/asset_registration_spec.rb
nsm-activeadmin-0.2.2 spec/unit/asset_registration_spec.rb
saulolso-activeadmin-0.2.2.1 spec/unit/asset_registration_spec.rb
saulolso-activeadmin-0.2.2 spec/unit/asset_registration_spec.rb
activeadmin-0.2.2 spec/unit/asset_registration_spec.rb