spec/mixpanel/tracker_spec.rb in mixpanel-4.0.2 vs spec/mixpanel/tracker_spec.rb in mixpanel-4.0.3

- old
+ new

@@ -39,9 +39,23 @@ it "should include img=1" do @mixpanel.tracking_pixel("Sign up").should match(/&img=1/) end end + context "Redirect url" do + let(:url) { "http://example.com?foo=bar&bar=foo" } + + it "should return a URL" do + @mixpanel.redirect_url("Click Email", url).should be_a(String) + end + + it "should include a redirect" do + encoded_url = CGI::escape(url) + @mixpanel.redirect_url("Click Email", url).should include('&redirect=' + encoded_url) + end + + end + context "Importing events" do it "should import simple events" do @mixpanel.import('Sign up').should == true end