I would create a spec_helper_integration file and put functionality specific to integration specs in there.
You should already have require 'rails_helper' at the top of all your specs. At the top of your integration specs put:
require 'rails_helper'
require 'spec_helper_integration'
Then create a spec_helper_integration.rb file in the same folder as your rails_helper.rb file.
spec_helper_integration:
#I'm taking a guesstimate as to your integration spec configuration, but it's
#likely something like the following line:
#don't also have this in your spec_helper or rails_helper files:
require 'capybara/rails'
#configure your integration specs:
RSpec.configure do |config|
config.before(:each) do
allow_any_instance_of(ApplicationController).to receive(:set_seo).and_return('seo_text')
end
end
It's good practice to isolate code to where it is required only; by doing this, your ApplicationController method stubbing is only activated during the running of your integration specs and not your other specs, such as unit or controller specs, for example.
Moving forward, any further integration-spec-specific code should only be put in your spec_helper_integration file, too.