added rspec testing, and fixed a method name