Added rspec tests and fixed two bugs

Hello guys, added the rspec tests for our app.
Also the tests cover basic funcionality plus fix the two known bugs.