]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/messages_controller_test.rb
Merge remote-tracking branch 'upstream/pull/2577'
[rails.git] / test / controllers / messages_controller_test.rb
index 8e4d5eeb27fd0f4cd062c2dc7627fa5dea2997cd..35bd4dc9f6b65dce19930b2a93229e5d9e14a1ee 100644 (file)
@@ -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
@@ -344,7 +344,7 @@ class MessagesControllerTest < ActionController::TestCase
     get :inbox
     assert_response :success
     assert_template "inbox"
-    assert_select "table.messages", :count => 1 do
+    assert_select ".content-inner > table", :count => 1 do
       assert_select "tr", :count => 2
       assert_select "tr#inbox-#{read_message.id}.inbox-row", :count => 1
     end
@@ -367,7 +367,7 @@ class MessagesControllerTest < ActionController::TestCase
     get :outbox
     assert_response :success
     assert_template "outbox"
-    assert_select "table.messages", :count => 1 do
+    assert_select ".content-inner > table", :count => 1 do
       assert_select "tr", :count => 2
       assert_select "tr.inbox-row", :count => 1
     end
@@ -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