Refactored to use rspec shared examples