X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/5405dde6ecb426fac26821f65b64773aa3e68c9f..b8a8a88004d25837a10436fdc13128146b32c32b:/test/controllers/messages_controller_test.rb diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index a5043a3f3..0b3a59b39 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -25,15 +25,15 @@ class MessagesControllerTest < ActionController::TestCase { :controller => "messages", :action => "show", :id => "1" } ) assert_routing( - { :path => "/message/mark/1", :method => :post }, + { :path => "/messages/1/mark", :method => :post }, { :controller => "messages", :action => "mark", :message_id => "1" } ) assert_routing( - { :path => "/message/reply/1", :method => :get }, + { :path => "/messages/1/reply", :method => :get }, { :controller => "messages", :action => "reply", :message_id => "1" } ) assert_routing( - { :path => "/message/reply/1", :method => :post }, + { :path => "/messages/1/reply", :method => :post }, { :controller => "messages", :action => "reply", :message_id => "1" } ) assert_routing( @@ -180,8 +180,8 @@ class MessagesControllerTest < ActionController::TestCase e = ActionMailer::Base.deliveries.first assert_equal [recipient_user.email], e.to 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(/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 ActionMailer::Base.deliveries.clear m = Message.last @@ -195,7 +195,7 @@ class MessagesControllerTest < ActionController::TestCase # Asking to send a message with a bogus user name should fail get :new, :params => { :display_name => "non_existent_user" } assert_response :not_found - assert_template "user/no_such_user" + assert_template "users/no_such_user" assert_select "h1", "The user non_existent_user does not exist" end @@ -232,14 +232,14 @@ class MessagesControllerTest < ActionController::TestCase # Check that the message reply page requires us to login get :reply, :params => { :message_id => unread_message.id } - assert_redirected_to login_path(:referer => reply_message_path(:message_id => unread_message.id)) + assert_redirected_to login_path(:referer => message_reply_path(:message_id => unread_message.id)) # Login as the wrong user session[:user] = other_user.id # Check that we can't reply to somebody else's message get :reply, :params => { :message_id => unread_message.id } - assert_redirected_to login_path(:referer => reply_message_path(:message_id => unread_message.id)) + assert_redirected_to login_path(:referer => message_reply_path(:message_id => unread_message.id)) assert_equal "You are logged in as `#{other_user.display_name}' but the message you have asked to reply to was not sent to that user. Please login as the correct user in order to reply.", flash[:notice] # Login as the right user