Permalink
Browse files

Always expect to have css and js files precompiled

don’t skip_pipeline for js and css files
  • Loading branch information...
bricesanchez committed Oct 9, 2017
1 parent 51f2677 commit 05677e5e9b800758b8e9a3d9cdbd4266d9d9065f
@@ -10,6 +10,6 @@
<% end %>
<%= yield :after_javascript_libraries -%>
<% custom_javascripts.each do |js| %>
<%= javascript_include_tag js, skip_pipeline: true %>
<%= javascript_include_tag js %>
<% end %>
<%= yield :javascripts %>
@@ -1,32 +1,40 @@
require "spec_helper"
module Refinery
describe "custom", :type => :feature do
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) }
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')
::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.js')).to be
expect(page.body.include?('custom_js')).to be
end
end
context "stylesheets" do
before do
::Refinery::Core.config.register_stylesheet('custom_css')
::Refinery::Core.config.register_stylesheet(custom_css)
end
it "should be rendered when specified" do
visit Refinery::Core.backend_path
expect(page.body).to include('custom_css.css')
expect(page.body.include?('custom_css')).to be
end
end
No changes.
No changes.

0 comments on commit 05677e5

Please sign in to comment.