Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RescueRegistry context warning in integration tests #54

Open
derikson opened this issue Nov 12, 2022 · 1 comment
Open

RescueRegistry context warning in integration tests #54

derikson opened this issue Nov 12, 2022 · 1 comment

Comments

@derikson
Copy link

Steps to reproduce

Create an integration test that makes at least two requests.

# frozen_string_literal: true

require 'bundler/inline'

gemfile(true) do
  source 'https://rubygems.org'

  gem 'rails'
  gem 'rescue_registry'
end

require 'action_controller/railtie'

class TestApp < Rails::Application
  config.root = __dir__
  config.hosts << 'www.example.com'

  config.logger = Logger.new($stdout)
  Rails.logger  = config.logger

  routes.draw do
    get '/' => 'test#index'
  end
end

class TestController < ActionController::Base
  def index
    render plain: 'Home'
  end
end

require 'minitest/autorun'
require 'rack/test'

class BugTest < ActionDispatch::IntegrationTest
  def test_rescue_registry_context
    get '/'
    get '/'
  end

  private

  def app
    Rails.application
  end
end

Expected behavior

No warnings are generated.

Actual behavior

Logging output contains:

WARN -- : Didn't expect RescueRegistry context to be set in controller
@wagenet
Copy link
Owner

wagenet commented Feb 14, 2023

@derikson Unfortunately, I haven't worked with Ruby since summer 2022 so I'm not going to be able to pay a lot of attention to this project. If you'd be interested in contributing, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants