Migrate to RSpec 3.0 and refactor tests