Skip to content

Remove skip statements from scaffold controller tests during smoke #1680

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

Closed
wants to merge 2 commits into from

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Jul 27, 2016

No description provided.

@JonRowe JonRowe force-pushed the trigger_controller_specs_in_smoke branch from 5272210 to 87fd5b7 Compare July 27, 2016 10:40
@fables-tales
Copy link
Member

I like this. @JonRowe is this good to merge?

@JonRowe
Copy link
Member Author

JonRowe commented Aug 4, 2016

I'm not positive this is doing what I want yet @samphippen, please bear with me :)

yujinakayama added a commit to rspec/rspec-dev that referenced this pull request Nov 5, 2016
This is for running example_app specs in rspec-rails repo:

* rspec/rspec-rails#1710
* rspec/rspec-rails#1680
@yujinakayama yujinakayama force-pushed the trigger_controller_specs_in_smoke branch 5 times, most recently from 9d10c76 to 677de24 Compare November 19, 2016 02:00
@yujinakayama yujinakayama force-pushed the trigger_controller_specs_in_smoke branch 4 times, most recently from 1213961 to 7dd96c2 Compare November 26, 2016 07:31
@yujinakayama yujinakayama force-pushed the trigger_controller_specs_in_smoke branch 4 times, most recently from 9e14923 to 875923b Compare April 10, 2017 05:08
@yujinakayama yujinakayama force-pushed the trigger_controller_specs_in_smoke branch from 875923b to 8ea835c Compare April 10, 2017 05:09
@yujinakayama
Copy link
Member

Now non-Rails 5 builds are properly failing.

@yujinakayama yujinakayama force-pushed the trigger_controller_specs_in_smoke branch from 8ea835c to a6b4678 Compare April 10, 2017 06:36
@yujinakayama yujinakayama changed the title [wip] remove skip statements from scaffold controller tests during smoke Remove skip statements from scaffold controller tests during smoke Apr 10, 2017
@yujinakayama
Copy link
Member

@JonRowe Is this good to merge?

@JonRowe
Copy link
Member Author

JonRowe commented Apr 11, 2017

@yujinakayama no this isn't ready to go yet, if you look at the build failure's it's failing because of routing issues rather than keyword arguments, you can see it's correctly grabbing params as a hash:

Failures:
  1) GadgetsController DELETE #destroy destroys the requested gadget
     Failure/Error: delete :destroy, params: {id: gadget.to_param}, session: valid_session
     
     ActionController::UrlGenerationError:
       No route matches {:action=>"destroy", :controller=>"gadgets", :params=>{:id=>"1"}, :session=>{}}
     # ./spec/controllers/gadgets_controller_spec.rb:130:in `block (4 levels) in <top (required)>'
     # ./spec/controllers/gadgets_controller_spec.rb:129:in `block (3 levels) in <top (required)>'

@yujinakayama
Copy link
Member

yujinakayama commented Apr 11, 2017

you can see it's correctly grabbing params as a hash:

No, Rails isn't correctly interpreting the keyword arguments.

You see the :params in the error message:

No route matches {:action=>"destroy", :controller=>"gadgets", :params=>{:id=>"1"}, :session=>{}}

... just because the :params is literally described as the hash key:

get :show, params: {id: gadget.to_param}, session: valid_session
#          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#          This entire hash is interpreted as a param

If we change the get invocation to the following:

get :show, foo: {id: gadget.to_param}, bar: valid_session

... you'll see the following error message:

No route matches {:action=>"show", :bar=>{}, :controller=>"gadgets", :foo=>{:id=>"1"}}

So that means, on Rails 4, the get :show, params: {id: gadget.to_param} is handled as params[:params] in the controller.

@JonRowe
Copy link
Member Author

JonRowe commented Apr 11, 2017

I'm not convinced this is ready but merge this into your branch and see if it goes green, if so the combined branch is good to go, (I don't feel that strongly about it) but otherwise it's not. We can't merge this as is as it'll break the build.

@yujinakayama
Copy link
Member

yujinakayama commented Apr 11, 2017

Then I'll close this PR and merge #1710, which is already based on this branch and is green.

@yujinakayama yujinakayama deleted the trigger_controller_specs_in_smoke branch April 11, 2017 05:16
@JonRowe
Copy link
Member Author

JonRowe commented Apr 11, 2017

Thanks for taking care of this @yujinakayama :)

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

Successfully merging this pull request may close these issues.

3 participants