#4 fixed the positions edit page throws 500

Fixed the positions edit page throws 500.
Add tests.
![zrzut ekranu z 2014-08-11 11 45 26](https://cloud.githubusercontent.com/assets/6718923/3875285/87f775a0-214f-11e4-89d3-9bca22c0501f.png)

still wrong, try testing this method in isolation to see if it really behaves as you would expect