1 require "application_system_test_case"
3 class BrowseCommentLinksTest < ApplicationSystemTestCase
4 test "visiting changeset comment link should pan to changeset" do
5 changeset = create(:changeset, :min_lat => 60 * GeoRecord::SCALE, :min_lon => 30 * GeoRecord::SCALE,
6 :max_lat => 60 * GeoRecord::SCALE, :max_lon => 30 * GeoRecord::SCALE)
7 comment = create(:changeset_comment, :changeset => changeset, :body => "Linked changeset comment")
9 visit changeset_path(changeset, :anchor => "c#{comment.id}")
12 assert_text "Linked changeset comment"
14 assert_match %r{map=\d+/60\.\d+/30\.\d+}, current_url
17 test "visiting note comment link should pan to note" do
18 note = create(:note, :latitude => 59 * GeoRecord::SCALE, :longitude => 29 * GeoRecord::SCALE)
19 create(:note_comment, :note => note, :body => "Note description")
20 comment = create(:note_comment, :note => note, :body => "Linked note comment", :event => "commented")
22 visit note_path(note, :anchor => "c#{comment.id}")
25 assert_text "Linked note comment"
27 assert_match %r{map=\d+/59\.\d+/29\.\d+}, current_url