Using an RSpec shared example to eliminate test duplication.