+ # 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")
+
+ get :edit, :params => { :gpx => 99999 }, :session => { :user => user }
+ assert_response :success
+ assert_template "edit"
+ assert_nil assigns(:lat)
+ assert_nil assigns(:lon)
+ assert_nil assigns(:zoom)
+
+ get :edit, :params => { :gpx => deleted_gpx.id }, :session => { :user => user }
+ assert_response :success
+ assert_template "edit"
+ assert_nil assigns(:lat)
+ assert_nil assigns(:lon)
+ assert_nil assigns(:zoom)
+
+ get :edit, :params => { :gpx => private_gpx.id }, :session => { :user => user }
+ assert_response :success
+ assert_template "edit"
+ assert_nil assigns(:lat)
+ assert_nil assigns(:lon)
+ assert_nil assigns(:zoom)
+ end
+