X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2f9291ba5764fe104264ae7e3b6a361e11212e8b..e39d227dd03f43985e38cd26ce6040772d571271:/test/controllers/messages_controller_test.rb diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index 8e4d5eeb2..0348163ba 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -190,7 +190,7 @@ class MessagesControllerTest < ActionController::TestCase assert_equal "[OpenStreetMap] Test Message", e.subject assert_match(/Test message body/, e.text_part.decoded) assert_match(/Test message body/, e.html_part.decoded) - assert_match %r{#{SERVER_URL}/messages/[0-9]+}, e.text_part.decoded + assert_match %r{#{Settings.server_url}/messages/[0-9]+}, e.text_part.decoded ActionMailer::Base.deliveries.clear m = Message.last assert_equal user.id, m.from_user_id @@ -483,12 +483,11 @@ class MessagesControllerTest < ActionController::TestCase private def with_message_limit(value) - max_messages_per_hour = Object.send("remove_const", "MAX_MESSAGES_PER_HOUR") - Object.const_set("MAX_MESSAGES_PER_HOUR", value) + max_messages_per_hour = Settings.max_messages_per_hour + Settings.max_messages_per_hour = value yield - Object.send("remove_const", "MAX_MESSAGES_PER_HOUR") - Object.const_set("MAX_MESSAGES_PER_HOUR", max_messages_per_hour) + Settings.max_messages_per_hour = max_messages_per_hour end end