Raise an error when tests hit the network

This commit is contained in:
Rohan Mitchell
2013-08-14 11:12:19 +10:00
parent 9c6c4724be
commit eaf71e28bb
3 changed files with 13 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ group :test, :development do
gem 'letter_opener'
gem 'timecop'
gem 'poltergeist'
gem 'webmock'
end
group :chili do

View File

@@ -223,6 +223,8 @@ GEM
sass (~> 3.1)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
crack (0.4.1)
safe_yaml (~> 0.9.0)
database_cleaner (0.7.1)
db2fog (0.8.0)
activerecord (~> 3.0)
@@ -388,6 +390,7 @@ GEM
rspec-mocks (~> 2.14.0)
ruby-hmac (0.4.0)
rubyzip (0.9.9)
safe_yaml (0.9.5)
sass (3.2.10)
sass-rails (3.2.6)
railties (~> 3.2.0)
@@ -445,6 +448,9 @@ GEM
railties (>= 3.0)
warden (1.2.1)
rack (>= 1.0)
webmock (1.13.0)
addressable (>= 2.2.7)
crack (>= 0.3.2)
websocket (1.0.7)
xpath (1.0.0)
nokogiri (~> 1.3)
@@ -505,4 +511,5 @@ DEPENDENCIES
turn (~> 0.8.3)
uglifier (>= 1.0.3)
unicorn
webmock
zurb-foundation!

View File

@@ -13,6 +13,11 @@ require 'rspec/rails'
require 'capybara'
require 'database_cleaner'
# Allow connections to phantomjs/selenium whilst raising errors
# when connecting to external sites
require 'webmock/rspec'
WebMock.disable_net_connect!(:allow_localhost => true)
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}