diff --git a/Gemfile b/Gemfile index c41388f49a..3333d9055c 100644 --- a/Gemfile +++ b/Gemfile @@ -70,6 +70,7 @@ group :test, :development do gem 'letter_opener' gem 'timecop' gem 'poltergeist' + gem 'webmock' end group :chili do diff --git a/Gemfile.lock b/Gemfile.lock index 011644699b..62f033c8b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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! diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7e200e2108..6a58af1a34 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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}