]> git.openstreetmap.org Git - rails.git/blob - test/system/browse_comment_links_test.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / system / browse_comment_links_test.rb
1 # frozen_string_literal: true
2
3 require "application_system_test_case"
4
5 class BrowseCommentLinksTest < ApplicationSystemTestCase
6   test "visiting changeset comment link should pan to changeset" do
7     changeset = create(:changeset, :bbox => [30, 60, 30, 60])
8     comment = create(:changeset_comment, :changeset => changeset, :body => "Linked changeset comment")
9
10     visit changeset_path(changeset, :anchor => "c#{comment.id}")
11
12     within_sidebar do
13       assert_text "Linked changeset comment"
14     end
15     assert_match %r{map=\d+/60\.\d+/30\.\d+}, current_url
16   end
17
18   test "visiting note comment link should pan to note" do
19     note = create(:note, :latitude => 59 * GeoRecord::SCALE, :longitude => 29 * GeoRecord::SCALE)
20     create(:note_comment, :note => note, :body => "Note description")
21     comment = create(:note_comment, :note => note, :body => "Linked note comment", :event => "commented")
22
23     visit note_path(note, :anchor => "c#{comment.id}")
24
25     within_sidebar do
26       assert_text "Linked note comment"
27     end
28     assert_match %r{map=\d+/59\.\d+/29\.\d+}, current_url
29   end
30 end