Skip to content

Commit

Permalink
Fix a few OSM->OHM related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erictheise committed Dec 3, 2024
1 parent fe75bed commit e48c35c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions test/controllers/api/changeset_comments_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_create_comment_success

email = ActionMailer::Base.deliveries.first
assert_equal 1, email.to.length
assert_equal "[OpenStreetMap] #{user.display_name} has commented on one of your changesets", email.subject
assert_equal "[OpenHistoricalMap] #{user.display_name} has commented on one of your changesets", email.subject
assert_equal private_user.email, email.to.first

ActionMailer::Base.deliveries.clear
Expand All @@ -88,12 +88,12 @@ def test_create_comment_success
email = ActionMailer::Base.deliveries.find { |e| e.to.first == private_user.email }
assert_not_nil email
assert_equal 1, email.to.length
assert_equal "[OpenStreetMap] #{user2.display_name} has commented on one of your changesets", email.subject
assert_equal "[OpenHistoricalMap] #{user2.display_name} has commented on one of your changesets", email.subject

email = ActionMailer::Base.deliveries.find { |e| e.to.first == user.email }
assert_not_nil email
assert_equal 1, email.to.length
assert_equal "[OpenStreetMap] #{user2.display_name} has commented on a changeset you are interested in", email.subject
assert_equal "[OpenHistoricalMap] #{user2.display_name} has commented on a changeset you are interested in", email.subject

ActionMailer::Base.deliveries.clear
end
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/changeset_comments/feeds_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_feed_timeout
end
assert_response :error
assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
assert_dom "rss>channel>title", :text => "OpenStreetMap changeset discussion"
assert_dom "rss>channel>title", :text => "OpenHistoricalMap changeset discussion"
assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
end

Expand All @@ -85,7 +85,7 @@ def test_feed_changeset_timeout
end
assert_response :error
assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
assert_dom "rss>channel>title", :text => "OpenStreetMap changeset #123 discussion"
assert_dom "rss>channel>title", :text => "OpenHistoricalMap changeset #123 discussion"
assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
end
end
Expand Down
6 changes: 3 additions & 3 deletions test/controllers/diary_entries_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup
# Create the default language for diary entries
create(:language, :code => "en")
# Stub nominatim response for diary entry locations
stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
stub_request(:get, %r{^https://nominatim\.openhistoricalmap\.org/reverse\?})
.to_return(:status => 404)
end

Expand Down Expand Up @@ -669,7 +669,7 @@ def test_show_og_image_with_no_image
assert_dom "> @content", ActionController::Base.helpers.image_url("osm_logo_256.png", :host => root_url)
end
assert_dom "head meta[property='og:image:alt']" do
assert_dom "> @content", "OpenStreetMap logo"
assert_dom "> @content", "OpenHistoricalMap logo"
end
end

Expand Down Expand Up @@ -739,7 +739,7 @@ def test_show_og_image_with_invalid_uri
assert_dom "> @content", ActionController::Base.helpers.image_url("osm_logo_256.png", :host => root_url)
end
assert_dom "head meta[property='og:image:alt']" do
assert_dom "> @content", "OpenStreetMap logo"
assert_dom "> @content", "OpenHistoricalMap logo"
end
end

Expand Down
14 changes: 7 additions & 7 deletions test/controllers/messages_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_new_form
get new_message_path(recipient_user)
assert_response :success
assert_template "new"
assert_select "title", "Send message | OpenStreetMap"
assert_select "title", "Send message | OpenHistoricalMap"
assert_select "a[href='#{user_path recipient_user}']", :text => recipient_user.display_name
assert_select "form[action='/messages']", :count => 1 do
assert_select "input[type='hidden'][name='display_name'][value='#{recipient_user.display_name}']"
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_new_get_with_params
end
assert_response :success
assert_template "new"
assert_select "title", "Send message | OpenStreetMap"
assert_select "title", "Send message | OpenHistoricalMap"
assert_select "form[action='/messages']", :count => 1 do
assert_select "input[type='hidden'][name='display_name'][value='#{recipient_user.display_name}']"
assert_select "input#message_title", :count => 1 do
Expand Down Expand Up @@ -121,7 +121,7 @@ def test_new_post_no_body
end
assert_response :success
assert_template "new"
assert_select "title", "Send message | OpenStreetMap"
assert_select "title", "Send message | OpenHistoricalMap"
assert_select "form[action='/messages']", :count => 1 do
assert_select "input[type='hidden'][name='display_name'][value='#{recipient_user.display_name}']"
assert_select "input#message_title", :count => 1 do
Expand Down Expand Up @@ -151,7 +151,7 @@ def test_new_post_no_title
end
assert_response :success
assert_template "new"
assert_select "title", "Send message | OpenStreetMap"
assert_select "title", "Send message | OpenHistoricalMap"
assert_select "form[action='/messages']", :count => 1 do
assert_select "input[type='hidden'][name='display_name'][value='#{recipient_user.display_name}']"
assert_select "input#message_title", :count => 1 do
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_new_post_send
assert_equal "Message sent", flash[:notice]
e = ActionMailer::Base.deliveries.first
assert_equal [recipient_user.email], e.to
assert_equal "[OpenStreetMap] Test Message", e.subject
assert_equal "[OpenHistoricalMap] 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{#{Settings.server_url}/messages/[0-9]+}, e.text_part.decoded
Expand Down Expand Up @@ -254,7 +254,7 @@ def test_reply
get message_reply_path(message)
assert_response :success
assert_template "new"
assert_select "title", "Re: #{message.title} | OpenStreetMap"
assert_select "title", "Re: #{message.title} | OpenHistoricalMap"
assert_select "form[action='/messages']", :count => 1 do
assert_select "input[type='hidden'][name='display_name'][value='#{user.display_name}']"
assert_select "input#message_title[value='Re: #{message.title}']", :count => 1
Expand All @@ -270,7 +270,7 @@ def test_reply
get message_reply_path(message)
assert_response :success
assert_template "new"
assert_select "title", "Re: #{message.title} | OpenStreetMap"
assert_select "title", "Re: #{message.title} | OpenHistoricalMap"
assert_select "form[action='/messages']", :count => 1 do
assert_select "input[type='hidden'][name='display_name'][value='#{recipient_user.display_name}']"
assert_select "input#message_title[value='Re: #{message.title}']", :count => 1
Expand Down
10 changes: 5 additions & 5 deletions test/helpers/title_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
class TitleHelperTest < ActionView::TestCase
def test_set_title
set_title
assert_equal "OpenStreetMap", response.header["X-Page-Title"]
assert_equal "OpenHistoricalMap", response.header["X-Page-Title"]
assert_nil @title

set_title(nil)
assert_equal "OpenStreetMap", response.header["X-Page-Title"]
assert_equal "OpenHistoricalMap", response.header["X-Page-Title"]
assert_nil @title

set_title("Test Title")
assert_equal "Test%20Title%20%7C%20OpenStreetMap", response.header["X-Page-Title"]
assert_equal "Test%20Title%20%7C%20OpenHistoricalMap", response.header["X-Page-Title"]
assert_equal "Test Title", @title

set_title("Test & Title")
assert_equal "Test%20%26%20Title%20%7C%20OpenStreetMap", response.header["X-Page-Title"]
assert_equal "Test%20%26%20Title%20%7C%20OpenHistoricalMap", response.header["X-Page-Title"]
assert_equal "Test & Title", @title

set_title("Tést & Tïtlè")
assert_equal "T%C3%A9st%20%26%20T%C3%AFtl%C3%A8%20%7C%20OpenStreetMap", response.header["X-Page-Title"]
assert_equal "T%C3%A9st%20%26%20T%C3%AFtl%C3%A8%20%7C%20OpenHistoricalMap", response.header["X-Page-Title"]
assert_equal "Tést & Tïtlè", @title
end
end
2 changes: 1 addition & 1 deletion test/system/site_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class SiteTest < ApplicationSystemTestCase
test "visiting the index" do
visit "/"

assert_selector "h1", :text => "OpenStreetMap"
assert_selector "h1", :text => "OpenHistoricalMap"
end

test "tooltip shows for Layers button" do
Expand Down
4 changes: 2 additions & 2 deletions test/system/user_logout_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UserLogoutTest < ApplicationSystemTestCase
assert_no_content "Log In"

visit logout_path
assert_content "Logout from OpenStreetMap"
assert_content "Logout from OpenHistoricalMap"

click_on "Logout"
assert_content "Log In"
Expand All @@ -39,7 +39,7 @@ class UserLogoutTest < ApplicationSystemTestCase
assert_no_content "Log In"

visit logout_path(:referer => "/traces")
assert_content "Logout from OpenStreetMap"
assert_content "Logout from OpenHistoricalMap"

click_on "Logout"
assert_content "Log In"
Expand Down

0 comments on commit e48c35c

Please sign in to comment.