+ end
+
+ # Test editing a specific node
+ def test_edit_with_node
+ user = users(:public_user)
+ node = current_nodes(:visible_node)
+
+ get :edit, { :node => node.id }, { :user => user.id }
+ assert_response :success
+ assert_template "edit"
+ assert_equal 1.0, assigns(:lat)
+ assert_equal 1.0, assigns(:lon)
+ assert_equal 18, assigns(:zoom)
+ end
+
+ # Test editing a specific way
+ def test_edit_with_way
+ user = users(:public_user)
+ way = current_ways(:visible_way)
+
+ get :edit, { :way => way.id }, { :user => user.id }
+ assert_response :success
+ assert_template "edit"
+ assert_equal 3.0, assigns(:lat)
+ assert_equal 3.0, assigns(:lon)
+ assert_equal 17, assigns(:zoom)
+ end
+
+ # Test editing a specific note
+ def test_edit_with_note
+ user = users(:public_user)
+ note = notes(:open_note)
+
+ get :edit, { :note => note.id }, { :user => user.id }
+ assert_response :success
+ assert_template "edit"
+ assert_equal 1.0, assigns(:lat)
+ assert_equal 1.0, assigns(:lon)
+ assert_equal 17, assigns(:zoom)
+ end
+
+ # Test editing a specific GPX trace
+ def test_edit_with_gpx
+ user = users(:public_user)
+ gpx = gpx_files(:public_trace_file)
+
+ get :edit, { :gpx => gpx.id }, { :user => user.id }
+ assert_response :success
+ assert_template "edit"
+ assert_equal 1.0, assigns(:lat)
+ assert_equal 1.0, assigns(:lon)
+ assert_equal 16, assigns(:zoom)
+ end
+
+ # Test the edit page redirects
+ def test_edit_redirect
+ get :edit, :lat => 4, :lon => 5
+ assert_redirected_to :controller => :site, :action => :edit, :anchor => 'map=5/4/5'
+
+ get :edit, :lat => 4, :lon => 5, :zoom => 3
+ assert_redirected_to :controller => :site, :action => :edit, :anchor => 'map=3/4/5'
+
+ get :edit, :lat => 4, :lon => 5, :zoom => 3, :editor => 'id'
+ assert_redirected_to :controller => :site, :action => :edit, :editor => 'id', :anchor => 'map=3/4/5'
+ end
+
+ # Test the copyright page
+ def test_copyright
+ get :copyright
+ assert_response :success
+ assert_template "copyright"
+ end
+
+ # Test the welcome page
+ def test_welcome
+ get :welcome
+ assert_response :redirect
+ assert_redirected_to :controller => :user, :action => :login, :referer => "/welcome"
+
+ get :welcome, nil, { :user => users(:public_user).id }
+ assert_response :success
+ assert_template "welcome"
+ end
+
+ # Test the fixthemap page
+ def test_fixthemap
+ get :fixthemap
+ assert_response :success
+ assert_template "fixthemap"
+ end
+
+ # Test the help page
+ def test_help
+ get :help
+ assert_response :success
+ assert_template "help"
+ end
+
+ # Test the about page
+ def test_about
+ get :about
+ assert_response :success
+ assert_template "about"
+ end
+
+ # Test the export page
+ def test_export
+ get :export
+ assert_response :success
+ assert_template "export"
+ assert_template :layout => "map"
+
+ xhr :get, :export
+ assert_response :success
+ assert_template "export"
+ assert_template :layout => "xhr"
+ end
+
+ # Test the offline page
+ def test_offline
+ get :offline
+ assert_response :success
+ assert_template "offline"
+ end
+
+ # Test the rich text preview
+ def test_preview
+ xhr :post, :preview, :format => "html"
+ assert_response :success
+
+ xhr :post, :preview, :format => "markdown"
+ assert_response :success
+
+ xhr :post, :preview, :format => "text"
+ assert_response :success
+ end
+
+ # Test the id frame
+ def test_id
+ get :id, nil, { :user => users(:public_user).id }
+ assert_response :success
+ assert_template "id"
+ assert_template :layout => false
+ end