{"action":"created","issue":{"url":"https://api.github.com/repos/glossier/solidus_retail/issues/27","repository_url":"https://api.github.com/repos/glossier/solidus_retail","labels_url":"https://api.github.com/repos/glossier/solidus_retail/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/glossier/solidus_retail/issues/27/comments","events_url":"https://api.github.com/repos/glossier/solidus_retail/issues/27/events","html_url":"https://github.com/glossier/solidus_retail/issues/27","id":177217514,"number":27,"title":"VCR not behaving correctly on Travis","user":{"login":"cabouffard","id":1725061,"avatar_url":"https://avatars.githubusercontent.com/u/1725061?v=3","gravatar_id":"","url":"https://api.github.com/users/cabouffard","html_url":"https://github.com/cabouffard","followers_url":"https://api.github.com/users/cabouffard/followers","following_url":"https://api.github.com/users/cabouffard/following{/other_user}","gists_url":"https://api.github.com/users/cabouffard/gists{/gist_id}","starred_url":"https://api.github.com/users/cabouffard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cabouffard/subscriptions","organizations_url":"https://api.github.com/users/cabouffard/orgs","repos_url":"https://api.github.com/users/cabouffard/repos","events_url":"https://api.github.com/users/cabouffard/events{/privacy}","received_events_url":"https://api.github.com/users/cabouffard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/glossier/solidus_retail/labels/help%20wanted","name":"help wanted","color":"128A0C"}],"state":"open","locked":false,"assignee":{"login":"DanielWright","id":642817,"avatar_url":"https://avatars.githubusercontent.com/u/642817?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielWright","html_url":"https://github.com/DanielWright","followers_url":"https://api.github.com/users/DanielWright/followers","following_url":"https://api.github.com/users/DanielWright/following{/other_user}","gists_url":"https://api.github.com/users/DanielWright/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielWright/subscriptions","organizations_url":"https://api.github.com/users/DanielWright/orgs","repos_url":"https://api.github.com/users/DanielWright/repos","events_url":"https://api.github.com/users/DanielWright/events{/privacy}","received_events_url":"https://api.github.com/users/DanielWright/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanielWright","id":642817,"avatar_url":"https://avatars.githubusercontent.com/u/642817?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielWright","html_url":"https://github.com/DanielWright","followers_url":"https://api.github.com/users/DanielWright/followers","following_url":"https://api.github.com/users/DanielWright/following{/other_user}","gists_url":"https://api.github.com/users/DanielWright/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielWright/subscriptions","organizations_url":"https://api.github.com/users/DanielWright/orgs","repos_url":"https://api.github.com/users/DanielWright/repos","events_url":"https://api.github.com/users/DanielWright/events{/privacy}","received_events_url":"https://api.github.com/users/DanielWright/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-09-15T16:00:42Z","updated_at":"2016-09-15T17:15:03Z","closed_at":null,"body":"I'm having big trouble with VCR at the moment, where the behavior is different on Travis compared to locally. \r\n\r\nLocally everything is green and I see that it uses the cassette correctly. When I look at the request URL of my cassettes, it requests at the proper URL which is:\r\n`https://1b7f63bf248831c7ae2beacf9bc30bbb:b1c915515d08e2037930a844f7436610@glossier-pop-staging.myshopify.com/x/y.json`\r\n\r\nWhen pushing to Travis, it makes requests to `https://glossier-pop-staging.myshopify.com/x/y`, which makes the requests fails due to VCR raising this error: `VCR::Errors::UnhandledHTTPRequestError`.\r\n\r\nThe way I setup the ShopifyURL is the following:\r\nhttps://github.com/glossier/solidus_retail/blob/69e5e6c906ed64f3a631a477c805ccd5d6e1bf33/config/initializers/shopify.rb\r\n\r\nHere is how I'm saving the cassettes: \r\n```ruby\r\n      if example.metadata[:type] == :request\r\n        name = example.metadata[:full_description].split(/\\s+/, 2).join('/').underscore.tr('.', '/').gsub(/[^\\w\\/]+/, '_').gsub(/\\/$/, '')\r\n        VCR.use_cassette(name, {}, &example)\r\n      else\r\n        VCR.turned_off(&example)\r\n      end\r\n```\r\n\r\nThe ENVS variables are correctly set.\r\n\r\nDW indirectly suggested that we mock the requests based on the domain name instead of the full URL by doing the following: https://github.com/glossier/solidus_retail/blob/321aac51dc215ad1a77e15f68e72adb62c281380/spec/support/vcr.rb\r\n\r\nThe problem with this implementation is that it seems to always return the same value when the same requests is being called multiple times in-within the same block. So if I fetch the number of Posts from the API at the beginning of my spec and later on down the road I refetch the number of posts, since the requests already exists it will return me the result of the first call, which is bonker and not what I want, since this makes my whole spec suite go red.\r\n\r\nAny suggestions? :slightly_smiling_face:"},"comment":{"url":"https://api.github.com/repos/glossier/solidus_retail/issues/comments/247391765","html_url":"https://github.com/glossier/solidus_retail/issues/27#issuecomment-247391765","issue_url":"https://api.github.com/repos/glossier/solidus_retail/issues/27","id":247391765,"user":{"login":"DanielWright","id":642817,"avatar_url":"https://avatars.githubusercontent.com/u/642817?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielWright","html_url":"https://github.com/DanielWright","followers_url":"https://api.github.com/users/DanielWright/followers","following_url":"https://api.github.com/users/DanielWright/following{/other_user}","gists_url":"https://api.github.com/users/DanielWright/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielWright/subscriptions","organizations_url":"https://api.github.com/users/DanielWright/orgs","repos_url":"https://api.github.com/users/DanielWright/repos","events_url":"https://api.github.com/users/DanielWright/events{/privacy}","received_events_url":"https://api.github.com/users/DanielWright/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T17:15:03Z","updated_at":"2016-09-15T17:15:03Z","body":"K, I'll carve out some time tomorrow to figure this out. Coolio?"}}
{"actor":{"display_login":"DanielWright"}}