diff --git a/lib/rack/livereload.rb b/lib/rack/livereload.rb index 4555892..803c4c5 100644 --- a/lib/rack/livereload.rb +++ b/lib/rack/livereload.rb @@ -61,7 +61,7 @@ module Rack content_length = 0 new_body.each do |line| - if !headers['X-Rack-LiveReload'] && (line[''] || line['' } + context 'at the top of the head tag' do + let(:page_html) { '
' } let(:body_dom) { Nokogiri::XML(body) } it 'should add the livereload js script tag before all other script tags' do + body_dom.at_css("head")[:attribute].should == 'attribute' body_dom.at_css("script:eq(4)")[:src].should include(described_class::LIVERELOAD_JS_PATH) body_dom.at_css("script:last-child")[:insert].should == "before" end