spec/mixpanel/middleware_spec.rb in mixpanel-4.0.2 vs spec/mixpanel/middleware_spec.rb in mixpanel-4.0.3
- old
+ new
@@ -46,9 +46,15 @@
it "should append mixpanel scripts without skip request" do
get "/"
Nokogiri::HTML(last_response.body).search('script').size.should == 1
end
+ it "should skip requests in the 3xx range" do
+ setup_rack_application(DummyApp, :body => html_document, :headers => {"Content-Type" => "text/html"}, :status => 350)
+ get "/"
+ Nokogiri::HTML(last_response.body).search('script').should be_empty
+ end
+
context "when disabling with #skip_this_request" do
before{ Mixpanel::Middleware.skip_this_request }
it "should skip this request but not the next request" do
get "/"