require 'rails_helper' shared_examples_for 'a generator' do |types| it { is_expected.to respond_with(200) } it "assigns #{types}" do expect(assigns(types)).to_not be_empty end end