+ # Test editing inaccessible GPX traces
+ def test_edit_with_inaccessible_gpxes
+ user = create(:user)
+ deleted_gpx = create(:trace, :deleted, :latitude => 1, :longitude => 1)
+ private_gpx = create(:trace, :latitude => 1, :longitude => 1, :visibility => "private")
+ session_for(user)
+
+ get edit_path(:gpx => 99999)
+ assert_response :success
+ assert_template "edit"
+ assert_nil assigns(:lat)
+ assert_nil assigns(:lon)
+ assert_nil assigns(:zoom)
+
+ get edit_path(:gpx => deleted_gpx.id)
+ assert_response :success
+ assert_template "edit"
+ assert_nil assigns(:lat)
+ assert_nil assigns(:lon)
+ assert_nil assigns(:zoom)
+
+ get edit_path(:gpx => private_gpx.id)
+ assert_response :success
+ assert_template "edit"
+ assert_nil assigns(:lat)
+ assert_nil assigns(:lon)
+ assert_nil assigns(:zoom)
+ end
+