Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Add test for A/B test Google Analytics tracking #231

Closed
wants to merge 1 commit into from

Conversation

alecgibson
Copy link
Contributor

@alecgibson alecgibson commented Feb 6, 2017

This test checks that we are correctly sending a page view tracking event to Google Analytics when A/B testing.

Note that this card is dependent upon:

Trello: https://trello.com/c/g9OyC7Pn/310-tell-google-analytics-about-a-b-tests


query = Rack::Utils.parse_query URI(analytics.first.url).query
expected_query = "Example:#{@ab_cookie_value}"
assert query['cd40'] == "Example:#{@ab_cookie_value}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this assertion use the local variable from line 49?

query = Rack::Utils.parse_query URI(analytics.first.url).query
expected_query = "Example:#{@ab_cookie_value}"
assert query['cd40'] == expected_query,
"Expected a query string cd40=#{expected_query} but instead found cd40=#{query['cd40']}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of most of this message if you use the RSpec expectation foo.should == bar or the MiniTest assertion assert_equal(foo, bar, "some message"), which give more informative default failure messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants