]> git.openstreetmap.org Git - rails.git/commitdiff
Resolve 96 Rubocop Lint/AmbiguousRegexpLiteral conflicts
authorWil <github@william-burns.com>
Fri, 8 Jun 2018 19:51:17 +0000 (15:51 -0400)
committerAndy Allan <git@gravitystorm.co.uk>
Mon, 10 Sep 2018 03:28:16 +0000 (11:28 +0800)
19 files changed:
.rubocop_todo.yml
app/helpers/notifier_helper.rb
test/controllers/amf_controller_test.rb
test/controllers/changeset_controller_test.rb
test/controllers/diary_entry_controller_test.rb
test/controllers/messages_controller_test.rb
test/controllers/old_node_controller_test.rb
test/controllers/redactions_controller_test.rb
test/controllers/swf_controller_test.rb
test/controllers/traces_controller_test.rb
test/controllers/user_controller_test.rb
test/integration/user_creation_test.rb
test/models/changeset_test.rb
test/models/message_test.rb
test/models/node_test.rb
test/models/old_node_test.rb
test/models/relation_test.rb
test/models/tracepoint_test.rb
test/models/way_test.rb

index f012237b31aba8b6fff09b291fa9f98ce279c6b4..f3151d2ff8824b64603bc631fa12eabb8c9fd5be 100644 (file)
@@ -14,10 +14,6 @@ Lint/AmbiguousOperator:
     - 'test/lib/bounding_box_test.rb'
     - 'test/lib/country_test.rb'
 
     - 'test/lib/bounding_box_test.rb'
     - 'test/lib/country_test.rb'
 
-# Offense count: 96
-Lint/AmbiguousRegexpLiteral:
-  Enabled: false
-
 # Offense count: 32
 # Configuration parameters: AllowSafeAssignment.
 Lint/AssignmentInCondition:
 # Offense count: 32
 # Configuration parameters: AllowSafeAssignment.
 Lint/AssignmentInCondition:
index dbd2d245d0dbfbccafaaef5a9af7a33188076f0f..2915a0880591b1e694db4a2d9c661756b1052af2 100644 (file)
@@ -29,6 +29,6 @@ module NotifierHelper
     # Because we can't use stylesheets in HTML emails, we need to inline the
     # styles. Rather than copy-paste the same string of CSS into every message,
     # we apply it once here, after the message has been composed.
     # Because we can't use stylesheets in HTML emails, we need to inline the
     # styles. Rather than copy-paste the same string of CSS into every message,
     # we apply it once here, after the message has been composed.
-    html.gsub /<p>/, '<p style="color: black; margin: 0.75em 0; font-family: \'Helvetica Neue\', Arial, Sans-Serif">'
+    html.gsub(/<p>/, '<p style="color: black; margin: 0.75em 0; font-family: \'Helvetica Neue\', Arial, Sans-Serif">')
   end
 end
   end
 end
index 5d7e1b778c5e1b950d12535928e7d1fc64dd3b34..b8cfd97cd8ab743ee78a69f6bd8eff6b7ae151ba 100644 (file)
@@ -499,7 +499,7 @@ class AmfControllerTest < ActionController::TestCase
 
     assert_equal 2, result.length
     assert_equal -1, result[0]
 
     assert_equal 2, result.length
     assert_equal -1, result[0]
-    assert_match /must be logged in/, result[1]
+    assert_match(/must be logged in/, result[1])
 
     blocked_user = create(:user)
     create(:user_block, :user => blocked_user)
 
     blocked_user = create(:user)
     create(:user_block, :user => blocked_user)
@@ -511,7 +511,7 @@ class AmfControllerTest < ActionController::TestCase
 
     assert_equal 2, result.length
     assert_equal -1, result[0]
 
     assert_equal 2, result.length
     assert_equal -1, result[0]
-    assert_match /access to the API has been blocked/, result[1]
+    assert_match(/access to the API has been blocked/, result[1])
   end
 
   def test_findgpx_by_id
   end
 
   def test_findgpx_by_id
@@ -941,7 +941,7 @@ class AmfControllerTest < ActionController::TestCase
 
     assert_equal 2, result.size
     assert_equal -2, result[0]
 
     assert_equal 2, result.size
     assert_equal -2, result[0]
-    assert_match /Node is not in the world/, result[1]
+    assert_match(/Node is not in the world/, result[1])
   end
 
   # check that we can create a way
   end
 
   # check that we can create a way
@@ -1194,7 +1194,7 @@ class AmfControllerTest < ActionController::TestCase
 
     assert_equal 2, result.size
     assert_equal -1, result[0]
 
     assert_equal 2, result.size
     assert_equal -1, result[0]
-    assert_match /Way #{way.id} is still used/, result[1]
+    assert_match(/Way #{way.id} is still used/, result[1])
 
     new_way = Way.find(way.id)
     assert_equal way.version, new_way.version
 
     new_way = Way.find(way.id)
     assert_equal way.version, new_way.version
@@ -1308,7 +1308,7 @@ class AmfControllerTest < ActionController::TestCase
 
     assert_equal 2, result.size
     assert_equal -1, result[0]
 
     assert_equal 2, result.size
     assert_equal -1, result[0]
-    assert_match /relation #{relation.id} is used in/, result[1]
+    assert_match(/relation #{relation.id} is used in/, result[1])
 
     new_relation = Relation.find(relation.id)
     assert_equal relation.version, new_relation.version
 
     new_relation = Relation.find(relation.id)
     assert_equal relation.version, new_relation.version
index a1be3fc0f0d63c4dbec8891c3936639c2cd2cbdb..40147ad467294df36933cfffc9cbf4551109b143 100644 (file)
@@ -213,7 +213,7 @@ class ChangesetControllerTest < ActionController::TestCase
         get :read, :params => { :id => id }
         assert_response :not_found, "should get a not found"
       rescue ActionController::UrlGenerationError => ex
         get :read, :params => { :id => id }
         assert_response :not_found, "should get a not found"
       rescue ActionController::UrlGenerationError => ex
-        assert_match /No route matches/, ex.to_s
+        assert_match(/No route matches/, ex.to_s)
       end
     end
   end
       end
     end
   end
@@ -287,7 +287,7 @@ class ChangesetControllerTest < ActionController::TestCase
         put :close, :params => { :id => id }
         assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized"
       rescue ActionController::UrlGenerationError => ex
         put :close, :params => { :id => id }
         assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized"
       rescue ActionController::UrlGenerationError => ex
-        assert_match /No route matches/, ex.to_s
+        assert_match(/No route matches/, ex.to_s)
       end
     end
 
       end
     end
 
@@ -298,7 +298,7 @@ class ChangesetControllerTest < ActionController::TestCase
         put :close, :params => { :id => id }
         assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed"
       rescue ActionController::UrlGenerationError => ex
         put :close, :params => { :id => id }
         assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed"
       rescue ActionController::UrlGenerationError => ex
-        assert_match /No route matches/, ex.to_s
+        assert_match(/No route matches/, ex.to_s)
       end
     end
   end
       end
     end
   end
index 98330f690f71e228e34b5ffc87ff58265f383534..633e55e347add70171dd07d38ad0309c586f9658 100644 (file)
@@ -414,8 +414,8 @@ class DiaryEntryControllerTest < ActionController::TestCase
     email = ActionMailer::Base.deliveries.first
     assert_equal [user.email], email.to
     assert_equal "[OpenStreetMap] #{other_user.display_name} commented on a diary entry", email.subject
     email = ActionMailer::Base.deliveries.first
     assert_equal [user.email], email.to
     assert_equal "[OpenStreetMap] #{other_user.display_name} commented on a diary entry", email.subject
-    assert_match /New comment/, email.text_part.decoded
-    assert_match /New comment/, email.html_part.decoded
+    assert_match(/New comment/, email.text_part.decoded)
+    assert_match(/New comment/, email.html_part.decoded)
     ActionMailer::Base.deliveries.clear
     comment = DiaryComment.order(:id).last
     assert_equal entry.id, comment.diary_entry_id
     ActionMailer::Base.deliveries.clear
     comment = DiaryComment.order(:id).last
     assert_equal entry.id, comment.diary_entry_id
index c5a117bcc4cecaa9ee219f036dfa87941850d54d..940144a174807df8b50742d06da09fc1a12ab7b1 100644 (file)
@@ -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
     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
     assert_match %r{#{SERVER_URL}/messages/[0-9]+}, e.text_part.decoded
     ActionMailer::Base.deliveries.clear
     m = Message.last
index 1f87431415dff2bd75ef7e46470a3e8091ba9dc3..346634f7d42d8b4f458b1f183567d58f9a3ca2ac 100644 (file)
@@ -161,7 +161,7 @@ class OldNodeControllerTest < ActionController::TestCase
     get :version, :params => { :id => id, :version => version }
     assert_response :not_found
   rescue ActionController::UrlGenerationError => ex
     get :version, :params => { :id => id, :version => version }
     assert_response :not_found
   rescue ActionController::UrlGenerationError => ex
-    assert_match /No route matches/, ex.to_s
+    assert_match(/No route matches/, ex.to_s)
   end
 
   ##
   end
 
   ##
index 73061ed57243af4913a5a73e903dc843001fc3ae..e2123f7250ee42afc9a0bbbf19dbfa1a47216c9f 100644 (file)
@@ -112,7 +112,7 @@ class RedactionsControllerTest < ActionController::TestCase
     delete :destroy, :params => { :id => redaction.id }
     assert_response :redirect
     assert_redirected_to(redaction_path(redaction))
     delete :destroy, :params => { :id => redaction.id }
     assert_response :redirect
     assert_redirected_to(redaction_path(redaction))
-    assert_match /^Redaction is not empty/, flash[:error]
+    assert_match(/^Redaction is not empty/, flash[:error])
   end
 
   def test_delete_non_moderator
   end
 
   def test_delete_non_moderator
index 6848f9a6543b9d08dffde8740acf665747570f97..2b8a19beb077a0823b660d616d3adc8a9a05789e 100644 (file)
@@ -26,19 +26,19 @@ class SwfControllerTest < ActionController::TestCase
     get :trackpoints, :params => { :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1 }
     assert_response :success
     assert_equal "application/x-shockwave-flash", response.content_type
     get :trackpoints, :params => { :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1 }
     assert_response :success
     assert_equal "application/x-shockwave-flash", response.content_type
-    assert_match /^FWS/, response.body
+    assert_match(/^FWS/, response.body)
     assert_equal 80, response.body.length
 
     get :trackpoints, :params => { :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1, :token => other_user.tokens.create.token }
     assert_response :success
     assert_equal "application/x-shockwave-flash", response.content_type
     assert_equal 80, response.body.length
 
     get :trackpoints, :params => { :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1, :token => other_user.tokens.create.token }
     assert_response :success
     assert_equal "application/x-shockwave-flash", response.content_type
-    assert_match /^FWS/, response.body
+    assert_match(/^FWS/, response.body)
     assert_equal 67, response.body.length
 
     get :trackpoints, :params => { :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1, :token => user.tokens.create.token }
     assert_response :success
     assert_equal "application/x-shockwave-flash", response.content_type
     assert_equal 67, response.body.length
 
     get :trackpoints, :params => { :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1, :token => user.tokens.create.token }
     assert_response :success
     assert_equal "application/x-shockwave-flash", response.content_type
-    assert_match /^FWS/, response.body
+    assert_match(/^FWS/, response.body)
     assert_equal 74, response.body.length
   end
 end
     assert_equal 74, response.body.length
   end
 end
index 605c47555fa6df496aa3b7bf154d83bdb6dd5a2c..32874d7d5722a3fe69370d365f632907e97ba7bc 100644 (file)
@@ -593,7 +593,7 @@ class TracesControllerTest < ActionController::TestCase
     post :create, :params => { :trace => { :gpx_file => file, :description => "New Trace", :tagstring => "new,trace", :visibility => "trackable" } }, :session => { :user => user }
     assert_response :redirect
     assert_redirected_to :action => :index, :display_name => user.display_name
     post :create, :params => { :trace => { :gpx_file => file, :description => "New Trace", :tagstring => "new,trace", :visibility => "trackable" } }, :session => { :user => user }
     assert_response :redirect
     assert_redirected_to :action => :index, :display_name => user.display_name
-    assert_match /file has been uploaded/, flash[:notice]
+    assert_match(/file has been uploaded/, flash[:notice])
     trace = Trace.order(:id => :desc).first
     assert_equal "a.gpx", trace.name
     assert_equal "New Trace", trace.description
     trace = Trace.order(:id => :desc).first
     assert_equal "a.gpx", trace.name
     assert_equal "New Trace", trace.description
index ba4b2ff3ac02a58c785843810d484f6d5e338b95..48e8b4119b8a7c6427a556d952c153b56bdcd907 100644 (file)
@@ -245,7 +245,7 @@ class UserControllerTest < ActionController::TestCase
     register_email = ActionMailer::Base.deliveries.first
 
     assert_equal register_email.to[0], user.email
     register_email = ActionMailer::Base.deliveries.first
 
     assert_equal register_email.to[0], user.email
-    assert_match /#{@url}/, register_email.body.to_s
+    assert_match(/#{@url}/, register_email.body.to_s)
 
     # Check the page
     assert_redirected_to :action => "confirm", :display_name => user.display_name
 
     # Check the page
     assert_redirected_to :action => "confirm", :display_name => user.display_name
@@ -404,7 +404,7 @@ class UserControllerTest < ActionController::TestCase
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to login_path
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to login_path
-    assert_match /Confirmed your account/, flash[:notice]
+    assert_match(/Confirmed your account/, flash[:notice])
   end
 
   def test_confirm_success_good_token_no_referer
   end
 
   def test_confirm_success_good_token_no_referer
@@ -427,7 +427,7 @@ class UserControllerTest < ActionController::TestCase
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }, :session => { :token => token }
     assert_redirected_to login_path
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }, :session => { :token => token }
     assert_redirected_to login_path
-    assert_match /Confirmed your account/, flash[:notice]
+    assert_match(/Confirmed your account/, flash[:notice])
   end
 
   def test_confirm_success_no_token_with_referer
   end
 
   def test_confirm_success_no_token_with_referer
@@ -438,7 +438,7 @@ class UserControllerTest < ActionController::TestCase
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to login_path(:referer => diary_new_path)
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to login_path(:referer => diary_new_path)
-    assert_match /Confirmed your account/, flash[:notice]
+    assert_match(/Confirmed your account/, flash[:notice])
   end
 
   def test_confirm_success_good_token_with_referer
   end
 
   def test_confirm_success_good_token_with_referer
@@ -461,7 +461,7 @@ class UserControllerTest < ActionController::TestCase
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }, :session => { :token => token }
     assert_redirected_to login_path(:referer => diary_new_path)
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }, :session => { :token => token }
     assert_redirected_to login_path(:referer => diary_new_path)
-    assert_match /Confirmed your account/, flash[:notice]
+    assert_match(/Confirmed your account/, flash[:notice])
   end
 
   def test_confirm_expired_token
   end
 
   def test_confirm_expired_token
@@ -471,7 +471,7 @@ class UserControllerTest < ActionController::TestCase
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to :action => "confirm"
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to :action => "confirm"
-    assert_match /confirmation code has expired/, flash[:error]
+    assert_match(/confirmation code has expired/, flash[:error])
   end
 
   def test_confirm_already_confirmed
   end
 
   def test_confirm_already_confirmed
@@ -481,7 +481,7 @@ class UserControllerTest < ActionController::TestCase
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to :action => "login"
     @request.cookies["_osm_session"] = user.display_name
     post :confirm, :params => { :display_name => user.display_name, :confirm_string => confirm_string }
     assert_redirected_to :action => "login"
-    assert_match /already been confirmed/, flash[:error]
+    assert_match(/already been confirmed/, flash[:error])
   end
 
   def test_confirm_resend_success
   end
 
   def test_confirm_resend_success
@@ -494,7 +494,7 @@ class UserControllerTest < ActionController::TestCase
 
     assert_response :redirect
     assert_redirected_to login_path
 
     assert_response :redirect
     assert_redirected_to login_path
-    assert_match /sent a new confirmation/, flash[:notice]
+    assert_match(/sent a new confirmation/, flash[:notice])
 
     email = ActionMailer::Base.deliveries.last
 
 
     email = ActionMailer::Base.deliveries.last
 
@@ -541,7 +541,7 @@ class UserControllerTest < ActionController::TestCase
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
-    assert_match /Confirmed your change of email address/, flash[:notice]
+    assert_match(/Confirmed your change of email address/, flash[:notice])
   end
 
   def test_confirm_email_already_confirmed
   end
 
   def test_confirm_email_already_confirmed
@@ -551,14 +551,14 @@ class UserControllerTest < ActionController::TestCase
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
-    assert_match /already been confirmed/, flash[:error]
+    assert_match(/already been confirmed/, flash[:error])
   end
 
   def test_confirm_email_bad_token
     post :confirm_email, :params => { :confirm_string => "XXXXX" }
     assert_response :success
     assert_template :confirm_email
   end
 
   def test_confirm_email_bad_token
     post :confirm_email, :params => { :confirm_string => "XXXXX" }
     assert_response :success
     assert_template :confirm_email
-    assert_match /confirmation code has expired or does not exist/, flash[:error]
+    assert_match(/confirmation code has expired or does not exist/, flash[:error])
   end
 
   ##
   end
 
   ##
@@ -575,7 +575,7 @@ class UserControllerTest < ActionController::TestCase
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
-    assert_match /Confirmed your change of email address/, flash[:notice]
+    assert_match(/Confirmed your change of email address/, flash[:notice])
     # gravatar use should now be enabled
     assert User.find(user.id).image_use_gravatar
   end
     # gravatar use should now be enabled
     assert User.find(user.id).image_use_gravatar
   end
@@ -590,7 +590,7 @@ class UserControllerTest < ActionController::TestCase
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
     post :confirm_email, :params => { :confirm_string => confirm_string }
     assert_response :redirect
     assert_redirected_to :action => :account, :display_name => user.display_name
-    assert_match /Confirmed your change of email address/, flash[:notice]
+    assert_match(/Confirmed your change of email address/, flash[:notice])
     # gravatar use should now be disabled
     assert_not User.find(user.id).image_use_gravatar
   end
     # gravatar use should now be disabled
     assert_not User.find(user.id).image_use_gravatar
   end
@@ -678,7 +678,7 @@ class UserControllerTest < ActionController::TestCase
     end
     assert_response :redirect
     assert_redirected_to :action => :login
     end
     assert_response :redirect
     assert_redirected_to :action => :login
-    assert_match /^Sorry you lost it/, flash[:notice]
+    assert_match(/^Sorry you lost it/, flash[:notice])
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal user.email, email.to.first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal user.email, email.to.first
@@ -691,7 +691,7 @@ class UserControllerTest < ActionController::TestCase
     end
     assert_response :redirect
     assert_redirected_to :action => :login
     end
     assert_response :redirect
     assert_redirected_to :action => :login
-    assert_match /^Sorry you lost it/, flash[:notice]
+    assert_match(/^Sorry you lost it/, flash[:notice])
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal uppercase_user.email, email.to.first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal uppercase_user.email, email.to.first
@@ -714,7 +714,7 @@ class UserControllerTest < ActionController::TestCase
     end
     assert_response :redirect
     assert_redirected_to :action => :login
     end
     assert_response :redirect
     assert_redirected_to :action => :login
-    assert_match /^Sorry you lost it/, flash[:notice]
+    assert_match(/^Sorry you lost it/, flash[:notice])
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal third_user.email, email.to.first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal third_user.email, email.to.first
@@ -727,7 +727,7 @@ class UserControllerTest < ActionController::TestCase
     end
     assert_response :redirect
     assert_redirected_to :action => :login
     end
     assert_response :redirect
     assert_redirected_to :action => :login
-    assert_match /^Sorry you lost it/, flash[:notice]
+    assert_match(/^Sorry you lost it/, flash[:notice])
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal third_user.email, email.to.first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert_equal third_user.email, email.to.first
@@ -1251,7 +1251,7 @@ class UserControllerTest < ActionController::TestCase
       post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     end
     assert_redirected_to user_path(:display_name => friend.display_name)
       post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     end
     assert_redirected_to user_path(:display_name => friend.display_name)
-    assert_match /is now your friend/, flash[:notice]
+    assert_match(/is now your friend/, flash[:notice])
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
@@ -1263,7 +1263,7 @@ class UserControllerTest < ActionController::TestCase
       post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     end
     assert_redirected_to user_path(:display_name => friend.display_name)
       post :make_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     end
     assert_redirected_to user_path(:display_name => friend.display_name)
-    assert_match /You are already friends with/, flash[:warning]
+    assert_match(/You are already friends with/, flash[:warning])
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
   end
 
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
   end
 
@@ -1290,7 +1290,7 @@ class UserControllerTest < ActionController::TestCase
       post :make_friend, :params => { :display_name => friend.display_name, :referer => "/test" }, :session => { :user => user }
     end
     assert_redirected_to "/test"
       post :make_friend, :params => { :display_name => friend.display_name, :referer => "/test" }, :session => { :user => user }
     end
     assert_redirected_to "/test"
-    assert_match /is now your friend/, flash[:notice]
+    assert_match(/is now your friend/, flash[:notice])
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
     email = ActionMailer::Base.deliveries.first
     assert_equal 1, email.to.count
@@ -1336,13 +1336,13 @@ class UserControllerTest < ActionController::TestCase
     # When logged in a POST should remove the friendship
     post :remove_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     assert_redirected_to user_path(:display_name => friend.display_name)
     # When logged in a POST should remove the friendship
     post :remove_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     assert_redirected_to user_path(:display_name => friend.display_name)
-    assert_match /was removed from your friends/, flash[:notice]
+    assert_match(/was removed from your friends/, flash[:notice])
     assert_nil Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
 
     # A second POST should report that the friendship does not exist
     post :remove_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     assert_redirected_to user_path(:display_name => friend.display_name)
     assert_nil Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
 
     # A second POST should report that the friendship does not exist
     post :remove_friend, :params => { :display_name => friend.display_name }, :session => { :user => user }
     assert_redirected_to user_path(:display_name => friend.display_name)
-    assert_match /is not one of your friends/, flash[:error]
+    assert_match(/is not one of your friends/, flash[:error])
     assert_nil Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
   end
 
     assert_nil Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
   end
 
@@ -1368,7 +1368,7 @@ class UserControllerTest < ActionController::TestCase
     # When logged in a POST should remove the friendship and refer
     post :remove_friend, :params => { :display_name => friend.display_name, :referer => "/test" }, :session => { :user => user }
     assert_redirected_to "/test"
     # When logged in a POST should remove the friendship and refer
     post :remove_friend, :params => { :display_name => friend.display_name, :referer => "/test" }, :session => { :user => user }
     assert_redirected_to "/test"
-    assert_match /was removed from your friends/, flash[:notice]
+    assert_match(/was removed from your friends/, flash[:notice])
     assert_nil Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
   end
 
     assert_nil Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
   end
 
index 20ee9a885a9952f4008741bc2f904f4d7ad36dcd..fbec2fb9338ce4e42a62e3e6ed4dab14a061eb76 100644 (file)
@@ -95,7 +95,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
 
       assert_equal register_email.to.first, new_email
       # Check that the confirm account url is correct
 
       assert_equal register_email.to.first, new_email
       # Check that the confirm account url is correct
-      assert_match /#{@url}/, register_email.body.to_s
+      assert_match(/#{@url}/, register_email.body.to_s)
 
       # Check the page
       assert_response :success
 
       # Check the page
       assert_response :success
index cdb1a8e85c409edab877b94ed42d9f5591be03a2..bc8c84fb1f0a0a017d183c144e8dc80fc98a8a6e 100644 (file)
@@ -6,11 +6,11 @@ class ChangesetTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_text, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_text, true)
     end
-    assert_match /Must specify a string with one or more characters/, message_create.message
+    assert_match(/Must specify a string with one or more characters/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_text, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_text, false)
     end
-    assert_match /Must specify a string with one or more characters/, message_update.message
+    assert_match(/Must specify a string with one or more characters/, message_update.message)
   end
 
   def test_from_xml_no_changeset
   end
 
   def test_from_xml_no_changeset
@@ -30,11 +30,11 @@ class ChangesetTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(nokv, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(nokv, true)
     end
-    assert_match /tag is missing key/, message_create.message
+    assert_match(/tag is missing key/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(nokv, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(nokv, false)
     end
-    assert_match /tag is missing key/, message_update.message
+    assert_match(/tag is missing key/, message_update.message)
   end
 
   def test_from_xml_no_v
   end
 
   def test_from_xml_no_v
@@ -42,11 +42,11 @@ class ChangesetTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_v, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_v, true)
     end
-    assert_match /tag is missing value/, message_create.message
+    assert_match(/tag is missing value/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_v, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Changeset.from_xml(no_v, false)
     end
-    assert_match /tag is missing value/, message_update.message
+    assert_match(/tag is missing value/, message_update.message)
   end
 
   def test_from_xml_duplicate_k
   end
 
   def test_from_xml_duplicate_k
index 48319843b9f91b2781c43fbf38e7c9fe2c039d8c..18b75f451e6aabe0aabef026e7750d136d23d115 100644 (file)
@@ -106,7 +106,7 @@ class MessageTest < ActiveSupport::TestCase
     assert_equal recipient_user, message.recipient
     assert_equal mail.date, message.sent_on
     assert_equal "Test message", message.title
     assert_equal recipient_user, message.recipient
     assert_equal mail.date, message.sent_on
     assert_equal "Test message", message.title
-    assert_match /^ *This is a test & a message *$/, message.body
+    assert_match(/^ *This is a test & a message *$/, message.body)
     assert_equal "text", message.body_format
   end
 
     assert_equal "text", message.body_format
   end
 
@@ -153,7 +153,7 @@ class MessageTest < ActiveSupport::TestCase
     assert_equal recipient_user, message.recipient
     assert_equal mail.date, message.sent_on
     assert_equal "Test message", message.title
     assert_equal recipient_user, message.recipient
     assert_equal mail.date, message.sent_on
     assert_equal "Test message", message.title
-    assert_match /^ *This is a test & a message in HTML format *$/, message.body
+    assert_match(/^ *This is a test & a message in HTML format *$/, message.body)
     assert_equal "text", message.body_format
   end
 
     assert_equal "text", message.body_format
   end
 
index a68be4aa9a30283da86cd8f987748828699c96f8..c53f0ee1d12ff78df52d93dca9e0c59f3688100e 100644 (file)
@@ -63,8 +63,8 @@ class NodeTest < ActiveSupport::TestCase
   def test_lat_lon_xml_format
     node = build(:node, :latitude => 0.00004 * OldNode::SCALE, :longitude => 0.00008 * OldNode::SCALE)
 
   def test_lat_lon_xml_format
     node = build(:node, :latitude => 0.00004 * OldNode::SCALE, :longitude => 0.00008 * OldNode::SCALE)
 
-    assert_match /lat="0.0000400"/, node.to_xml.to_s
-    assert_match /lon="0.0000800"/, node.to_xml.to_s
+    assert_match(/lat="0.0000400"/, node.to_xml.to_s)
+    assert_match(/lon="0.0000800"/, node.to_xml.to_s)
   end
 
   # Check that you can create a node and store it
   end
 
   # Check that you can create a node and store it
@@ -173,7 +173,7 @@ class NodeTest < ActiveSupport::TestCase
     message = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(noid, false)
     end
     message = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(noid, false)
     end
-    assert_match /ID is required when updating./, message.message
+    assert_match(/ID is required when updating./, message.message)
   end
 
   def test_from_xml_no_lat
   end
 
   def test_from_xml_no_lat
@@ -181,11 +181,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolat, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolat, true)
     end
-    assert_match /lat missing/, message_create.message
+    assert_match(/lat missing/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolat, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolat, false)
     end
-    assert_match /lat missing/, message_update.message
+    assert_match(/lat missing/, message_update.message)
   end
 
   def test_from_xml_no_lon
   end
 
   def test_from_xml_no_lon
@@ -193,11 +193,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolon, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolon, true)
     end
-    assert_match /lon missing/, message_create.message
+    assert_match(/lon missing/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolon, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nolon, false)
     end
-    assert_match /lon missing/, message_update.message
+    assert_match(/lon missing/, message_update.message)
   end
 
   def test_from_xml_no_changeset_id
   end
 
   def test_from_xml_no_changeset_id
@@ -205,11 +205,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, true)
     end
-    assert_match /Changeset id is missing/, message_create.message
+    assert_match(/Changeset id is missing/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, false)
     end
-    assert_match /Changeset id is missing/, message_update.message
+    assert_match(/Changeset id is missing/, message_update.message)
   end
 
   def test_from_xml_no_version
   end
 
   def test_from_xml_no_version
@@ -220,7 +220,7 @@ class NodeTest < ActiveSupport::TestCase
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_version, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_version, false)
     end
-    assert_match /Version is required when updating/, message_update.message
+    assert_match(/Version is required when updating/, message_update.message)
   end
 
   def test_from_xml_double_lat
   end
 
   def test_from_xml_double_lat
@@ -228,11 +228,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, true)
     end
-    assert_match /Fatal error: Attribute lat redefined at/, message_create.message
+    assert_match(/Fatal error: Attribute lat redefined at/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nocs, false)
     end
-    assert_match /Fatal error: Attribute lat redefined at/, message_update.message
+    assert_match(/Fatal error: Attribute lat redefined at/, message_update.message)
   end
 
   def test_from_xml_id_zero
   end
 
   def test_from_xml_id_zero
@@ -245,7 +245,7 @@ class NodeTest < ActiveSupport::TestCase
       message_update = assert_raise(OSM::APIBadUserInput) do
         Node.from_xml(zero_id, false)
       end
       message_update = assert_raise(OSM::APIBadUserInput) do
         Node.from_xml(zero_id, false)
       end
-      assert_match /ID of node cannot be zero when updating/, message_update.message
+      assert_match(/ID of node cannot be zero when updating/, message_update.message)
     end
   end
 
     end
   end
 
@@ -254,11 +254,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_text, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_text, true)
     end
-    assert_match /Must specify a string with one or more characters/, message_create.message
+    assert_match(/Must specify a string with one or more characters/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_text, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_text, false)
     end
-    assert_match /Must specify a string with one or more characters/, message_update.message
+    assert_match(/Must specify a string with one or more characters/, message_update.message)
   end
 
   def test_from_xml_no_node
   end
 
   def test_from_xml_no_node
@@ -278,11 +278,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nokv, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nokv, true)
     end
-    assert_match /tag is missing key/, message_create.message
+    assert_match(/tag is missing key/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nokv, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(nokv, false)
     end
-    assert_match /tag is missing key/, message_update.message
+    assert_match(/tag is missing key/, message_update.message)
   end
 
   def test_from_xml_no_v
   end
 
   def test_from_xml_no_v
@@ -290,11 +290,11 @@ class NodeTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_v, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_v, true)
     end
-    assert_match /tag is missing value/, message_create.message
+    assert_match(/tag is missing value/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_v, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Node.from_xml(no_v, false)
     end
-    assert_match /tag is missing value/, message_update.message
+    assert_match(/tag is missing value/, message_update.message)
   end
 
   def test_from_xml_duplicate_k
   end
 
   def test_from_xml_duplicate_k
index 42097c8531b18a612ca2e705fa6f9d4eeb7d4763..4aadd5e47ef4da536de4fda35f910bd029960de0 100644 (file)
@@ -63,8 +63,8 @@ class OldNodeTest < ActiveSupport::TestCase
   def test_lat_lon_xml_format
     old_node = build(:old_node, :latitude => 0.00004 * OldNode::SCALE, :longitude => 0.00008 * OldNode::SCALE)
 
   def test_lat_lon_xml_format
     old_node = build(:old_node, :latitude => 0.00004 * OldNode::SCALE, :longitude => 0.00008 * OldNode::SCALE)
 
-    assert_match /lat="0.0000400"/, old_node.to_xml.to_s
-    assert_match /lon="0.0000800"/, old_node.to_xml.to_s
+    assert_match(/lat="0.0000400"/, old_node.to_xml.to_s)
+    assert_match(/lon="0.0000800"/, old_node.to_xml.to_s)
   end
 
   def test_node_tags
   end
 
   def test_node_tags
index b06cbd9b85843be99ab930df7048f58092c989f8..b4fdfff6bafce45166cdfa7edcd9d8e3dfecf60e 100644 (file)
@@ -9,7 +9,7 @@ class RelationTest < ActiveSupport::TestCase
     message = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(noid, false)
     end
     message = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(noid, false)
     end
-    assert_match /ID is required when updating/, message.message
+    assert_match(/ID is required when updating/, message.message)
   end
 
   def test_from_xml_no_changeset_id
   end
 
   def test_from_xml_no_changeset_id
@@ -17,11 +17,11 @@ class RelationTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nocs, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nocs, true)
     end
-    assert_match /Changeset id is missing/, message_create.message
+    assert_match(/Changeset id is missing/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nocs, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nocs, false)
     end
-    assert_match /Changeset id is missing/, message_update.message
+    assert_match(/Changeset id is missing/, message_update.message)
   end
 
   def test_from_xml_no_version
   end
 
   def test_from_xml_no_version
@@ -32,7 +32,7 @@ class RelationTest < ActiveSupport::TestCase
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_version, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_version, false)
     end
-    assert_match /Version is required when updating/, message_update.message
+    assert_match(/Version is required when updating/, message_update.message)
   end
 
   def test_from_xml_id_zero
   end
 
   def test_from_xml_id_zero
@@ -45,7 +45,7 @@ class RelationTest < ActiveSupport::TestCase
       message_update = assert_raise(OSM::APIBadUserInput) do
         Relation.from_xml(zero_id, false)
       end
       message_update = assert_raise(OSM::APIBadUserInput) do
         Relation.from_xml(zero_id, false)
       end
-      assert_match /ID of relation cannot be zero when updating/, message_update.message
+      assert_match(/ID of relation cannot be zero when updating/, message_update.message)
     end
   end
 
     end
   end
 
@@ -54,11 +54,11 @@ class RelationTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_text, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_text, true)
     end
-    assert_match /Must specify a string with one or more characters/, message_create.message
+    assert_match(/Must specify a string with one or more characters/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_text, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_text, false)
     end
-    assert_match /Must specify a string with one or more characters/, message_update.message
+    assert_match(/Must specify a string with one or more characters/, message_update.message)
   end
 
   def test_from_xml_no_k_v
   end
 
   def test_from_xml_no_k_v
@@ -66,11 +66,11 @@ class RelationTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nokv, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nokv, true)
     end
-    assert_match /tag is missing key/, message_create.message
+    assert_match(/tag is missing key/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nokv, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(nokv, false)
     end
-    assert_match /tag is missing key/, message_update.message
+    assert_match(/tag is missing key/, message_update.message)
   end
 
   def test_from_xml_no_v
   end
 
   def test_from_xml_no_v
@@ -78,11 +78,11 @@ class RelationTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_v, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_v, true)
     end
-    assert_match /tag is missing value/, message_create.message
+    assert_match(/tag is missing value/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_v, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Relation.from_xml(no_v, false)
     end
-    assert_match /tag is missing value/, message_update.message
+    assert_match(/tag is missing value/, message_update.message)
   end
 
   def test_from_xml_duplicate_k
   end
 
   def test_from_xml_duplicate_k
index 670db5bceecdd6acc1d754f870b3ef0179bb17b9..a672b7c62b9de9e0374afc4f93470e730c154e75 100644 (file)
@@ -12,7 +12,7 @@ class TracepointTest < ActiveSupport::TestCase
   def test_lat_lon_xml_format
     tracepoint = build(:tracepoint, :latitude => 0.00004 * GeoRecord::SCALE, :longitude => 0.00008 * GeoRecord::SCALE)
 
   def test_lat_lon_xml_format
     tracepoint = build(:tracepoint, :latitude => 0.00004 * GeoRecord::SCALE, :longitude => 0.00008 * GeoRecord::SCALE)
 
-    assert_match /lat="0.0000400"/, tracepoint.to_xml_node.to_s
-    assert_match /lon="0.0000800"/, tracepoint.to_xml_node.to_s
+    assert_match(/lat="0.0000400"/, tracepoint.to_xml_node.to_s)
+    assert_match(/lon="0.0000800"/, tracepoint.to_xml_node.to_s)
   end
 end
   end
 end
index 6abf99c575948824cc5cfd38abd674dbbb6ae8ae..fb37be1b4fdfb40b31a49957222ae32f9b1dd036 100644 (file)
@@ -48,7 +48,7 @@ class WayTest < ActiveSupport::TestCase
     message = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(noid, false)
     end
     message = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(noid, false)
     end
-    assert_match /ID is required when updating/, message.message
+    assert_match(/ID is required when updating/, message.message)
   end
 
   def test_from_xml_no_changeset_id
   end
 
   def test_from_xml_no_changeset_id
@@ -56,11 +56,11 @@ class WayTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nocs, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nocs, true)
     end
-    assert_match /Changeset id is missing/, message_create.message
+    assert_match(/Changeset id is missing/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nocs, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nocs, false)
     end
-    assert_match /Changeset id is missing/, message_update.message
+    assert_match(/Changeset id is missing/, message_update.message)
   end
 
   def test_from_xml_no_version
   end
 
   def test_from_xml_no_version
@@ -71,7 +71,7 @@ class WayTest < ActiveSupport::TestCase
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_version, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_version, false)
     end
-    assert_match /Version is required when updating/, message_update.message
+    assert_match(/Version is required when updating/, message_update.message)
   end
 
   def test_from_xml_id_zero
   end
 
   def test_from_xml_id_zero
@@ -84,7 +84,7 @@ class WayTest < ActiveSupport::TestCase
       message_update = assert_raise(OSM::APIBadUserInput) do
         Way.from_xml(zero_id, false)
       end
       message_update = assert_raise(OSM::APIBadUserInput) do
         Way.from_xml(zero_id, false)
       end
-      assert_match /ID of way cannot be zero when updating/, message_update.message
+      assert_match(/ID of way cannot be zero when updating/, message_update.message)
     end
   end
 
     end
   end
 
@@ -93,11 +93,11 @@ class WayTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_text, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_text, true)
     end
-    assert_match /Must specify a string with one or more characters/, message_create.message
+    assert_match(/Must specify a string with one or more characters/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_text, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_text, false)
     end
-    assert_match /Must specify a string with one or more characters/, message_update.message
+    assert_match(/Must specify a string with one or more characters/, message_update.message)
   end
 
   def test_from_xml_no_k_v
   end
 
   def test_from_xml_no_k_v
@@ -105,11 +105,11 @@ class WayTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nokv, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nokv, true)
     end
-    assert_match /tag is missing key/, message_create.message
+    assert_match(/tag is missing key/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nokv, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(nokv, false)
     end
-    assert_match /tag is missing key/, message_update.message
+    assert_match(/tag is missing key/, message_update.message)
   end
 
   def test_from_xml_no_v
   end
 
   def test_from_xml_no_v
@@ -117,11 +117,11 @@ class WayTest < ActiveSupport::TestCase
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_v, true)
     end
     message_create = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_v, true)
     end
-    assert_match /tag is missing value/, message_create.message
+    assert_match(/tag is missing value/, message_create.message)
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_v, false)
     end
     message_update = assert_raise(OSM::APIBadXMLError) do
       Way.from_xml(no_v, false)
     end
-    assert_match /tag is missing value/, message_update.message
+    assert_match(/tag is missing value/, message_update.message)
   end
 
   def test_from_xml_duplicate_k
   end
 
   def test_from_xml_duplicate_k