spec/mixpanel/middleware_spec.rb in mixpanel-3.5.1 vs spec/mixpanel/middleware_spec.rb in mixpanel-3.5.2
- old
+ new
@@ -45,9 +45,21 @@
it "should append mixpanel scripts without skip request" do
get "/"
Nokogiri::HTML(last_response.body).search('script').size.should == 1
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 "/"
+ Nokogiri::HTML(last_response.body).search('script').should be_empty
+ get "/"
+ Nokogiri::HTML(last_response.body).search('script').size.should == 1
+ end
+
+ end
end
describe "Appending async mixpanel scripts" do
describe "With ajax requests" do
before do