Expected(200) <=> Actual(404 Not Found) #3828

Closed
jamesvanklink opened this Issue Jan 21, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@jamesvanklink

I'm working on writing a rspec test using Carrierwave and Fog. I'm trying to mock Fog and have
Fog.mock!
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml')
connection = Fog::Storage.new(provider: 'AWS')
connection.directories.create(key: CarrierWave::Uploader::Base.fog_directory)

In a file in my support directory and am including it in my controller test. However, it is not finding the bucket in the verify_mock_bucket_exists method. I checked the list of buckets it has and it is an empty list and does not have the one I created above. I've looked around and everything I'm finding says this should be the solution but it won't work for me and I'm not sure why.

I'm using ruby 2.2.3, fog 1.37.0 and fog-aws 0.8.1.

Thanks

@geemus

This comment has been minimized.

Show comment
Hide comment
@geemus

geemus Jan 22, 2016

Member

That should work, I think. It does use the credentials to segregate mock data though, so be sure the controllers and/or tests are using the same credentials as the directory create there or you may have issues. Otherwise I would expect that to work though. Let me know if you still come up short and I can certainly help troubleshoot further. Thanks!

Member

geemus commented Jan 22, 2016

That should work, I think. It does use the credentials to segregate mock data though, so be sure the controllers and/or tests are using the same credentials as the directory create there or you may have issues. Otherwise I would expect that to work though. Let me know if you still come up short and I can certainly help troubleshoot further. Thanks!

@jamesvanklink

This comment has been minimized.

Show comment
Hide comment
@jamesvanklink

jamesvanklink Feb 10, 2016

That indeed was the issue. Thanks for the help.

That indeed was the issue. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment