diff --git a/lib/hanami/rspec/generators/support_requests.rb b/lib/hanami/rspec/generators/support_requests.rb index f1c8f9a..b1b7c7e 100644 --- a/lib/hanami/rspec/generators/support_requests.rb +++ b/lib/hanami/rspec/generators/support_requests.rb @@ -2,11 +2,12 @@ require "rack/test" -RSpec.shared_context "Hanami app" do +RSpec.shared_context "Rack::Test" do + # Define the app for Rack::Test requests let(:app) { Hanami.app } end RSpec.configure do |config| config.include Rack::Test::Methods, type: :request - config.include_context "Hanami app", type: :request + config.include_context "Rack::Test", type: :request end diff --git a/spec/unit/hanami/rspec/commands/install_spec.rb b/spec/unit/hanami/rspec/commands/install_spec.rb index 22671eb..1ed09e3 100644 --- a/spec/unit/hanami/rspec/commands/install_spec.rb +++ b/spec/unit/hanami/rspec/commands/install_spec.rb @@ -129,13 +129,14 @@ require "rack/test" - RSpec.shared_context "Hanami app" do + RSpec.shared_context "Rack::Test" do + # Define the app for Rack::Test requests let(:app) { Hanami.app } end RSpec.configure do |config| config.include Rack::Test::Methods, type: :request - config.include_context "Hanami app", type: :request + config.include_context "Rack::Test", type: :request end EOF expect(fs.read("spec/support/requests.rb")).to eq(support_requests)