From c52c5e1b4270f2ed7fce23a2ce5e236922a4ef68 Mon Sep 17 00:00:00 2001 From: Trevor Smith Date: Fri, 27 Feb 2015 19:23:37 -0700 Subject: [PATCH] Only inject JS into the first instance of . --- lib/rack/livereload/body_processor.rb | 2 +- spec/rack/livereload/body_processor_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/rack/livereload/body_processor.rb b/lib/rack/livereload/body_processor.rb index c5fc029..a8fbe87 100644 --- a/lib/rack/livereload/body_processor.rb +++ b/lib/rack/livereload/body_processor.rb @@ -71,7 +71,7 @@ module Rack @new_body.each do |line| if !@livereload_added && line['' } + + it 'should not add the livereload js' do + processed_body.should include('var html=""') + end + end + context 'not vendored' do before do processor.stubs(:use_vendored?).returns(false)