Skip to content

Commit

Permalink
simplify tests, fix rails 3.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dougcole committed Feb 27, 2012
1 parent c15e22b commit 3f6e3ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/rails_helper_test.rb
Expand Up @@ -27,11 +27,12 @@ def test_ab_test_using_js_returns_the_same_alternative
end

def test_vanity_track_url_for_returns_url_with_identity_and_metrics
expected = rails3? ? "/controller/action?_identity=123&_track=sugar_high" : "/controller/action?_identity=123&_track=sugar_high"
assert_equal expected, vanity_track_url_for("123", :sugar_high, :controller => "controller", :action => "action")
self.expects(:url_for).with(:controller => "controller", :action => "action", :_identity => '123', :_track => :sugar_high)
vanity_track_url_for("123", :sugar_high, :controller => "controller", :action => "action")
end

def test_vanity_tracking_image
assert_equal image_tag("/vanity/image?_identity=123&_track=sugar_high", :width => "1px", :height => "1px", :alt => ""), vanity_tracking_image("123", :sugar_high, options = {})
self.expects(:url_for).with(:controller => :vanity, :action => :image, :_identity => '123', :_track => :sugar_high).returns("/url")
assert_equal image_tag("/url", :width => "1px", :height => "1px", :alt => ""), vanity_tracking_image("123", :sugar_high, options = {})
end
end

0 comments on commit 3f6e3ad

Please sign in to comment.