diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index fa6ce5f..3e82c41 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -34,5 +34,6 @@ = render :partial => "devise/login_modal" =yield :scripts - :javascript - window._idl={};_idl.variant="banner";(function(){var e=document.createElement("script");e.type="text/javascript";e.async=true;e.src=("https:"==document.location.protocol?"https://":"http://")+"members.internetdefenseleague.org/include/?url="+(_idl.url||"")+"&campaign="+(_idl.campaign||"")+"&variant="+(_idl.variant||"banner");document.getElementsByTagName("body")[0].appendChild(e)})() + - unless Rails.env.test? + :javascript + window._idl={};_idl.variant="banner";(function(){var e=document.createElement("script");e.type="text/javascript";e.async=true;e.src=("https:"==document.location.protocol?"https://":"http://")+"members.internetdefenseleague.org/include/?url="+(_idl.url||"")+"&campaign="+(_idl.campaign||"")+"&variant="+(_idl.variant||"banner");document.getElementsByTagName("body")[0].appendChild(e)})() diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 39c004a..7972ff3 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -8,7 +8,7 @@ def nyc_location mock_location end - describe "current_school" do + describe "current_school with geocoding on", geocode: true do it "defaults to school for the nearest venue" do school1 = create(:school) diff --git a/spec/support/gmaps4rails.rb b/spec/support/gmaps4rails.rb new file mode 100644 index 0000000..d9588e0 --- /dev/null +++ b/spec/support/gmaps4rails.rb @@ -0,0 +1,9 @@ +RSpec.configure do |config| + config.before(:each) do |example| + unless self.class.metadata[:geocode] == true + Gmaps4rails::ModelHandler.any_instance.stub(:prevent_geocoding?) do + true + end + end + end +end