From 0f4f593c897b772e84c557fb9973d00273d43720 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Mon, 21 Oct 2013 17:21:16 +1100
Subject: [PATCH] correct broken test

---
 app/controllers/categories_controller.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
index 058db07ddc3..5110dc6d57b 100644
--- a/app/controllers/categories_controller.rb
+++ b/app/controllers/categories_controller.rb
@@ -53,15 +53,15 @@ class CategoriesController < ApplicationController
     return render_json_error(@category) unless @category.save
 
     @category.move_to(category_params[:position].to_i) if category_params[:position]
-
     render_serialized(@category, CategorySerializer)
   end
 
   def update
     guardian.ensure_can_edit!(@category)
     json_result(@category, serializer: CategorySerializer) { |cat|
-      cat.update_attributes(category_params)
       cat.move_to(category_params[:position].to_i) if category_params[:position]
+      category_params.delete(:position)
+      cat.update_attributes(category_params)
     }
   end