Files
openproject/spec/support/rspec_request_specs.rb
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00

27 lines
651 B
Ruby

# frozen_string_literal: true
module RackTestHelper
include Rack::Test::Methods
def app
Rails.application
end
end
module CapybaraPage
def page
Capybara.string(response.body)
end
end
RSpec.configure do |config|
# Use Rack::Test for regular request specs (esp. API requests)
config.include RackTestHelper, type: :request
# If desired, we can use the Rails IntegrationTest request spec
# (more like a feature spec) with this type.
config.include RSpec::Rails::RequestExampleGroup, type: :rails_request
config.include Capybara::RSpecMatchers, type: :rails_request
config.include CapybaraPage, type: :rails_request
end