1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

WIP: Attempt to stub image request

This commit is contained in:
Daniel Barber 2015-10-30 11:17:11 +00:00
parent 1b326fd0a0
commit 8909d25e3e
2 changed files with 4 additions and 1 deletions

1
.env.test Normal file
View File

@ -0,0 +1 @@
export CLOUDINARY_CLOUD_NAME=test

View File

@ -10,7 +10,9 @@ feature 'visitor navigates site' do
end end
it 'increments the view counter when an image is displayed', js: true do it 'increments the view counter when an image is displayed', js: true do
stub_request(:get, 'http://res.cloudinary.com/danbarber/image/upload/photo.jpg') image = File.read(File.join(fixture_path, 'photo.jpg'))
stub_request(:get, 'http://res.cloudinary.com/test/image/upload/photo.jpg')
.to_return(body: image, headers: { 'Content-Type' => 'image/jpeg' })
category = create(:category) category = create(:category)
photo = create(:photo, image_cloudinary_id: 'photo', featured: true, categories: [category]) photo = create(:photo, image_cloudinary_id: 'photo', featured: true, categories: [category])