fix typo and use newer rspec syntax refactor

https://www.pivotaltracker.com/story/show/76232594
fix problems with the code identified by NikitaAvvakumov
during PR code review