implemented Rspec tests