Sha256: bc6fe2fe6d3c67ae9b04d04d6f4b335e289001dc03b17cc323b305dc1873653c

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require "spec_helper"

module Refinery
  describe "custom", type: :feature do
    refinery_login

    let(:custom_js){ Refinery.roots('refinery/core').join('spec/support/fixtures/custom_js.js') }
    let(:custom_css){ Refinery.roots('refinery/core').join('spec/support/fixtures/custom_css.css') }

    before do
      Rails.application.config.assets.precompile += %W( #{custom_js} #{custom_css} )
    end

    after do
      Refinery::Core.javascripts.reject! { |j| %W[#{custom_js}].include?(j) }
      Refinery::Core.stylesheets.reject! { |s| %W[#{custom_css}].include?(s.path) }
    end

    context "javascripts" do
      before do
        ::Refinery::Core.config.register_javascript(custom_js)
      end

      it "should be rendered when specified" do
        visit Refinery::Core.backend_path
        expect(page.body.include?('custom_js')).to be
      end
    end

    context "stylesheets" do
      before do
        ::Refinery::Core.config.register_stylesheet(custom_css)
      end

      it "should be rendered when specified" do
        visit Refinery::Core.backend_path
        expect(page.body.include?('custom_css')).to be
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinerycms-core-4.0.3 spec/features/refinery/admin/custom_assets_spec.rb
refinerycms-core-4.0.2 spec/features/refinery/admin/custom_assets_spec.rb
refinerycms-core-4.0.1 spec/features/refinery/admin/custom_assets_spec.rb