diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..a4a2515 --- /dev/null +++ b/.env.test @@ -0,0 +1 @@ +export CLOUDINARY_CLOUD_NAME=test diff --git a/spec/features/visitor_navigates_site_spec.rb b/spec/features/visitor_navigates_site_spec.rb index 70b9a3f..bade776 100644 --- a/spec/features/visitor_navigates_site_spec.rb +++ b/spec/features/visitor_navigates_site_spec.rb @@ -10,7 +10,9 @@ feature 'visitor navigates site' do end 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) photo = create(:photo, image_cloudinary_id: 'photo', featured: true, categories: [category])