mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Mock photo request for feature spec
This commit is contained in:
parent
6658c03d66
commit
1b326fd0a0
1
Gemfile
1
Gemfile
@ -67,3 +67,4 @@ gem 'skylight'
|
|||||||
gem 'slugtastic'
|
gem 'slugtastic'
|
||||||
gem 'squeel'
|
gem 'squeel'
|
||||||
gem 'unf'
|
gem 'unf'
|
||||||
|
gem 'webmock'
|
||||||
|
|||||||
@ -99,6 +99,8 @@ GEM
|
|||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.9.1.1)
|
coffee-script-source (1.9.1.1)
|
||||||
|
crack (0.4.2)
|
||||||
|
safe_yaml (~> 1.0.0)
|
||||||
database_cleaner (1.5.0)
|
database_cleaner (1.5.0)
|
||||||
datetime_picker_rails (0.0.4)
|
datetime_picker_rails (0.0.4)
|
||||||
momentjs-rails (>= 2.8.1)
|
momentjs-rails (>= 2.8.1)
|
||||||
@ -280,6 +282,7 @@ GEM
|
|||||||
ruby-progressbar (1.7.5)
|
ruby-progressbar (1.7.5)
|
||||||
ruby_parser (3.7.1)
|
ruby_parser (3.7.1)
|
||||||
sexp_processor (~> 4.1)
|
sexp_processor (~> 4.1)
|
||||||
|
safe_yaml (1.0.4)
|
||||||
sass (3.4.19)
|
sass (3.4.19)
|
||||||
sass-rails (5.0.4)
|
sass-rails (5.0.4)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
@ -330,6 +333,9 @@ GEM
|
|||||||
unf_ext (0.0.7.1)
|
unf_ext (0.0.7.1)
|
||||||
warden (1.2.3)
|
warden (1.2.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
|
webmock (1.21.0)
|
||||||
|
addressable (>= 2.3.6)
|
||||||
|
crack (>= 0.3.2)
|
||||||
websocket-driver (0.6.2)
|
websocket-driver (0.6.2)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.2)
|
||||||
@ -382,6 +388,7 @@ DEPENDENCIES
|
|||||||
squeel
|
squeel
|
||||||
uglifier
|
uglifier
|
||||||
unf
|
unf
|
||||||
|
webmock
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.10.6
|
1.10.6
|
||||||
|
|||||||
@ -10,8 +10,10 @@ 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')
|
||||||
|
|
||||||
category = create(:category)
|
category = create(:category)
|
||||||
photo = create(:photo, featured: true, categories: [category])
|
photo = create(:photo, image_cloudinary_id: 'photo', featured: true, categories: [category])
|
||||||
|
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ require File.expand_path('../../config/environment', __FILE__)
|
|||||||
require 'rspec/rails'
|
require 'rspec/rails'
|
||||||
require 'capybara/rspec'
|
require 'capybara/rspec'
|
||||||
require 'capybara/poltergeist'
|
require 'capybara/poltergeist'
|
||||||
|
require 'webmock/rspec'
|
||||||
|
|
||||||
# For code coverage
|
# For code coverage
|
||||||
require 'simplecov'
|
require 'simplecov'
|
||||||
@ -16,6 +17,8 @@ Capybara.javascript_driver = :poltergeist
|
|||||||
# in spec/support/ and its subdirectories.
|
# in spec/support/ and its subdirectories.
|
||||||
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
||||||
|
|
||||||
|
WebMock.disable_net_connect!(:allow_localhost => true)
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
# ## Mock Framework
|
# ## Mock Framework
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user