- '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:
# 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
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)
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
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
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
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
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
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
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
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
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
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
##
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
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_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_match /^FWS/, response.body
+ assert_match(/^FWS/, response.body)
assert_equal 74, response.body.length
end
end
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
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
@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
@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
@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
@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
@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
@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
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
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
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
- 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
##
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
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
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
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
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
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
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
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
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
# 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_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
# 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_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
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
- 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
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
- 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
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
- 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
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 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
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
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
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
- assert_match /lat missing/, message_update.message
+ assert_match(/lat missing/, message_update.message)
end
def test_from_xml_no_lon
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
- assert_match /lon missing/, message_update.message
+ assert_match(/lon missing/, message_update.message)
end
def test_from_xml_no_changeset_id
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
- 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
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
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
- 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
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
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
- 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
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
- 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
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
- 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
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
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
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
- 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
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
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
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
- 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
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
- 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
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
- 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
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
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
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
- 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
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
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
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
- 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
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
- 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
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
- 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