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, :bbox => [30, 60, 30, 60])
 
   6     comment = create(:changeset_comment, :changeset => changeset, :body => "Linked changeset comment")
 
   8     visit changeset_path(changeset, :anchor => "c#{comment.id}")
 
  11       assert_text "Linked changeset comment"
 
  13     assert_match %r{map=\d+/60\.\d+/30\.\d+}, current_url
 
  16   test "visiting note comment link should pan to note" do
 
  17     note = create(:note, :latitude => 59 * GeoRecord::SCALE, :longitude => 29 * GeoRecord::SCALE)
 
  18     create(:note_comment, :note => note, :body => "Note description")
 
  19     comment = create(:note_comment, :note => note, :body => "Linked note comment", :event => "commented")
 
  21     visit note_path(note, :anchor => "c#{comment.id}")
 
  24       assert_text "Linked note comment"
 
  26     assert_match %r{map=\d+/59\.\d+/29\.\d+}, current_url