1 require "application_system_test_case"
3 class ChangesetElementsTest < ApplicationSystemTestCase
4 test "can navigate between element subpages without losing comment input" do
6 changeset = create(:changeset, :closed)
7 ways = create_list(:way, element_page_size + 1, :with_history, :changeset => changeset)
8 way_paths = ways.map { |way| way_path(way) }
9 nodes = create_list(:node, element_page_size + 1, :with_history, :changeset => changeset)
10 node_paths = nodes.map { |node| node_path(node) }
12 sign_in_as(create(:user))
13 visit changeset_path(changeset)
16 assert_one_missing_link way_paths
17 assert_link "Ways (21-21 of 21)"
19 assert_one_missing_link node_paths
20 assert_link "Nodes (21-21 of 21)"
26 def assert_one_missing_link(hrefs)
30 assert_link :href => href, :minimum => 0, :maximum => 1 do
34 assert_nil missing_href, "unexpected extra missing link '#{href}'"
38 assert_not_nil missing_href, "expected one link missing but all are present"