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

Fix with_routing not working with get :index #1777

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jan 9, 2020

  1. Configuration menu
    Copy the full SHA
    731d813 View commit details
    Browse the repository at this point in the history
  2. Fix with_routing not working with get :index

    As guys previously mentioned in the thread the problem is that `#get` is called on
    other context then `#with_routing`.
    
    It is caused by
    https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/example/controller_example_group.rb#L5.
    ActionDispatch::Assertions::RoutingAssertions is adding #with_routing to
    an assertion_instance, and ActionController::TestCase::Behavior is
    adding #get to ControllerExampleGroup.
    
    So I decided to add an ControllerAssertionDelegator which will include
    both of them. Actually AssertionDelegator missed some methods, so I
    featured them in that delegator.
    
    Closes rspec#1652
    sclinede committed Jan 9, 2020
    Configuration menu
    Copy the full SHA
    afebe67 View commit details
    Browse the repository at this point in the history