Added test spec/controller/positions_controller_spec.rb, and some bugfix.