Sha256: ce0370143a6918f278e483df48c58d5f9355f48fc495486f361ca0f45d1a2296

Contents?: true

Size: 1.89 KB

Versions: 11

Compression:

Stored size: 1.89 KB

Contents

require "spec_helper"

module Refinery
  describe CustomAssetsHelper do
    describe "custom_javascripts" do
      before do
        Refinery::Core.clear_javascripts!
      end

      it "should return one custom javascript in array when one javascript is registred" do
        Refinery::Core.config.register_javascript("test")
        helper.custom_javascripts.should eq ["test"]
      end

      it "should return two custom javascripts in array when two javascripts are registred" do
        Refinery::Core.config.register_javascript("test")
        Refinery::Core.config.register_javascript("parndt")
        helper.custom_javascripts.should eq ["test", "parndt"]
      end

      it "should return empty array when no javascript is registred" do
        helper.custom_javascripts.should eq []
      end
    end

    describe "custom_stylesheets" do
      before do
        Refinery::Core.clear_stylesheets!
      end

      it "should return one custom stylesheet class in array when one stylesheet is registred" do
        Refinery::Core.config.register_stylesheet("test")
        helper.custom_stylesheets.first.path.should eq "test"
      end

      it "should return two custom stylesheet classes in array when two stylesheets are registred" do
        Refinery::Core.config.register_stylesheet("test")
        Refinery::Core.config.register_stylesheet("parndt")
        helper.custom_stylesheets.collect(&:path).should eq ["test", "parndt"]
      end

      it "should return empty array when no stylesheet is registred" do
        helper.custom_stylesheets.should eq []
      end

      it "should return stylesheet class with path and options when both are specified" do
        Refinery::Core.config.register_stylesheet("test", :media => 'screen')
        helper.custom_stylesheets.first.path.should eq("test")
        helper.custom_stylesheets.first.options.should eq({:media => 'screen'})
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-core-2.1.5 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.1.4 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.1.3 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.1.2 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.1.1 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.1.0 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.0.10 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.0.9 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.0.8 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.0.7 spec/helpers/refinery/custom_assets_helper_spec.rb
refinerycms-core-2.0.6 spec/helpers/refinery/custom_assets_helper_spec.rb