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

Give unauthorized access #7

Open
Aru1 opened this issue Nov 28, 2012 · 6 comments
Open

Give unauthorized access #7

Aru1 opened this issue Nov 28, 2012 · 6 comments

Comments

@Aru1
Copy link

Aru1 commented Nov 28, 2012

Hi,
I installed the gem. It didn't create any fixture folder. when i run the example give by you, it gave me unauthorized access error

@Aru1
Copy link
Author

Aru1 commented Nov 28, 2012

This occur because when internet is on, it tries to authenticate with live shopify and when off, it give error for fakeweb NetConnectNotAllowed error

@cannikin
Copy link

This original issue is from > 2 years ago, but I'm seeing something similar today:

rails c test

ShopifyAPI::Mock.enabled?
=> true
ShopifyAPI::Mock.allow_internet?
=> true
order = ShopifyAPI::Session.temp("test", "randomtoken") { ShopifyAPI::Order.first }
=> ActiveResource::UnauthorizedAccess: Failed.  Response code = 401.  Response message = Unauthorized.

ShopifyAPI::Mock.allow_internet = false
=> false
order = ShopifyAPI::Session.temp("test", "randomtoken") { ShopifyAPI::Order.first }
=> FakeWeb::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: GET https://test.myshopify.com/admin/orders.json

Did something change in Rails 4.2?

@jasonbuehler
Copy link

It seems like this project might not be active anymore, this problem is fixed over on this fork:
https://github.com/reverbdev/shopify-mock

@travishaynes
Copy link
Owner

Yeah, this project hasn't been worked on in a long time. Shortly after I wrote this gem I discovered ActiveResource::HttpMock and have been using that ever since. I have been considering updating this gem to use that instead of FakeWeb, but I'm pretty busy with other projects at the moment and don't know when I can get to it. But I will be updating this gem eventually. I just don't know when.

@cannikin
Copy link

Neat, I didn't know about HttpMock, that's pretty handy. Looks like a little more manual setup than this gem, but should do the same job.

@travishaynes
Copy link
Owner

I've started a new branch for implemented the HttpMock version of the gem. I'm still working on setting up all the fixtures, but I've got a pretty good start on it.

https://github.com/travishaynes/shopify-mock/tree/httpmock

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

No branches or pull requests

4 participants