1 require "application_system_test_case"
3 class ElementHistoryTest < ApplicationSystemTestCase
4 test "can view node history" do
5 node = create(:node, :with_history, :version => 41)
9 check_element_history(->(v) { old_node_path(node, v) })
12 test "can view way history" do
13 way = create(:way, :with_history, :version => 41)
17 check_element_history(->(v) { old_way_path(way, v) })
20 test "can view relation history" do
21 relation = create(:relation, :with_history, :version => 41)
23 visit relation_path(relation)
25 check_element_history(->(v) { old_relation_path(relation, v) })
30 def check_element_history(get_path)
32 click_on "View History"
35 assert_link v.to_s, :href => get_path.call(v)
38 click_on "Older Versions"
41 assert_link v.to_s, :href => get_path.call(v)
44 click_on "Older Versions"
47 assert_link v.to_s, :href => get_path.call(v)
50 assert_no_link "Older Versions"