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

Fix tracking issues with #131 #147

Merged
merged 1 commit into from
Sep 22, 2015
Merged

Fix tracking issues with #131 #147

merged 1 commit into from
Sep 22, 2015

Conversation

jschwindt
Copy link
Contributor

Hi,

I started using page.tracked?, page.untracked_url and page.untrack! and all three fail with URLs that don't have query values, for example:

page = MetaInspector.new('http://example.com/foo')
page.tracked?
NoMethodError: undefined method `keys' for nil:NilClass
    from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/metainspector-4.6.1/lib/meta_inspector/url.rb:34:in `tracked?'

At the same time, if the URL has only tracking query values, the untracked_url method returns the URL with the question mark (?) at the end:

page = MetaInspector.new('http://example.com/foo?utm_source=twitter')
page.untracked_url
=> "http://example.com/foo?"

I created the missing tests that reproduced those errors and fixed the API.

Hope it helps.

Juan.

jaimeiniesta added a commit that referenced this pull request Sep 22, 2015
@jaimeiniesta jaimeiniesta merged commit d7464d7 into jaimeiniesta:master Sep 22, 2015
@jaimeiniesta
Copy link
Owner

👍 thanks!

@jschwindt jschwindt deleted the fix_131 branch June 13, 2016 14:39
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.

2 participants