update rspec to use shared example to eliminate test duplication