Rspec

add testing code and modify