rspec - add multiple types to a test

Viewed 374

wondering if it's possible to have a test tagged with multiple types, for example:

  it 'should run as part of smoke or integration tests', :type => 'smoke,integration' do
    response = @sample_request.echo("EXAMPLE5", "EXAMPLE6")
    expect(response.status).to equal(200)
  end

and have it run when either of the the two filters is applied:

bundle exec rspec --tag type:smoke

OR

bundle exec rspec --tag type:integration
1 Answers

You should be able to do this using an array.

it '...', :type => ['smoke', 'integration'] do

Related