spec/mixpanel/middleware_spec.rb in mixpanel-3.5.0 vs spec/mixpanel/middleware_spec.rb in mixpanel-3.5.1
- old
+ new
@@ -192,9 +192,21 @@
it "should append mixpanel scripts to end of body element" do
Nokogiri::HTML(last_response.body).search('head script').should be_empty
Nokogiri::HTML(last_response.body).search('body script').should_not be_empty
end
end
+
+ describe "With no mixpanel scripts" do
+ before do
+ setup_rack_application(DummyApp, {:body => html_document, :headers => {"Content-Type" => "text/html"}}, {:insert_mixpanel_scripts => false})
+ get "/"
+ end
+
+ it "should not insert mixpanel scripts" do
+ Nokogiri::HTML(last_response.body).search('head script').should be_empty
+ Nokogiri::HTML(last_response.body).search('body script').should be_empty
+ end
+ end
end
end
describe "Tracking async appended events" do
before do