]> git.openstreetmap.org Git - rails.git/blob - test/system/browse_comment_links_test.rb
Move api changeset index tests up
[rails.git] / test / system / browse_comment_links_test.rb
1 require "application_system_test_case"
2
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")
8
9     visit changeset_path(changeset, :anchor => "c#{comment.id}")
10
11     within_sidebar do
12       assert_text "Linked changeset comment"
13     end
14     assert_match %r{map=\d+/60\.\d+/30\.\d+}, current_url
15   end
16
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")
21
22     visit note_path(note, :anchor => "c#{comment.id}")
23
24     within_sidebar do
25       assert_text "Linked note comment"
26     end
27     assert_match %r{map=\d+/59\.\d+/29\.\d+}, current_url
28   end
29 end