From e219916dcbb00fe179d27a3c1b32139c511f9c2e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 5 Sep 2019 20:30:34 +0100 Subject: [PATCH] When overriding setup make sure to call the superclass --- test/controllers/api/notes_controller_test.rb | 1 + test/controllers/api/users_controller_test.rb | 2 ++ test/controllers/diary_entries_controller_test.rb | 1 + test/controllers/notes_controller_test.rb | 1 + test/controllers/site_controller_test.rb | 2 ++ test/controllers/users_controller_test.rb | 2 ++ 6 files changed, 9 insertions(+) diff --git a/test/controllers/api/notes_controller_test.rb b/test/controllers/api/notes_controller_test.rb index 5f449f0d6..54a20028d 100644 --- a/test/controllers/api/notes_controller_test.rb +++ b/test/controllers/api/notes_controller_test.rb @@ -3,6 +3,7 @@ require "test_helper" module Api class NotesControllerTest < ActionController::TestCase def setup + super # Stub nominatim response for note locations stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?}) .to_return(:status => 404) diff --git a/test/controllers/api/users_controller_test.rb b/test/controllers/api/users_controller_test.rb index 93a7eeb55..de402ebf8 100644 --- a/test/controllers/api/users_controller_test.rb +++ b/test/controllers/api/users_controller_test.rb @@ -3,6 +3,8 @@ require "test_helper" module Api class UsersControllerTest < ActionController::TestCase def setup + super + stub_hostip_requests end diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index 8414e18a7..e959133a0 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -4,6 +4,7 @@ class DiaryEntriesControllerTest < ActionController::TestCase include ActionView::Helpers::NumberHelper def setup + super # Create the default language for diary entries create(:language, :code => "en") # Stub nominatim response for diary entry locations diff --git a/test/controllers/notes_controller_test.rb b/test/controllers/notes_controller_test.rb index 82821de6c..5c71d722f 100644 --- a/test/controllers/notes_controller_test.rb +++ b/test/controllers/notes_controller_test.rb @@ -2,6 +2,7 @@ require "test_helper" class NotesControllerTest < ActionController::TestCase def setup + super # Stub nominatim response for note locations stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?}) .to_return(:status => 404) diff --git a/test/controllers/site_controller_test.rb b/test/controllers/site_controller_test.rb index a2ea86f6f..c7826062b 100644 --- a/test/controllers/site_controller_test.rb +++ b/test/controllers/site_controller_test.rb @@ -4,6 +4,8 @@ class SiteControllerTest < ActionController::TestCase ## # setup oauth keys def setup + super + Settings.id_key = create(:client_application).key Settings.potlatch2_key = create(:client_application).key diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index 62e06fc58..feca92df5 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -2,6 +2,8 @@ require "test_helper" class UsersControllerTest < ActionController::TestCase def setup + super + stub_hostip_requests end -- 2.39.5