Fix typos and refactor tests with RSpec features