-
Notifications
You must be signed in to change notification settings - Fork 53
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
Adding rails-controller-testing** gem does not fix NoMethodError message #5
Comments
@JasonW i'll have to fix this. The gem was built under the assumption that the methods would have only been deprecated and not raise a warning. Sorry about that 😘 |
Question: Will this fix be in this gem or in Rails? |
@jasnow I couldn't replicate the issue with the demo app. Could you check if you have the latest version of the Gem installed? Thanks 😄 |
You must run "bundle update" and add the new gem and then run "rake" and see that adding the new gem did not get rid of the message. |
Ah ok. This only happens when using RSpec, let me have another look at it. |
Hi, I'm using the default Rails testing framework, and I am still seeing the same issue as @jasnow. If you take a look at this repo, you can run |
@sPark008 Ok I'm seeing the same failures with your app. Could you try out https://github.com/tgxworld/test-app and see if the tests passes for you? |
@sPark008 Ah I see what is happening for your app. Your app is using a custom |
+1, upgraded an existing app to edge rails and tests (Minitest) give the message despite having the gem installed at version |
@redbassett RSpec or Minitest? |
Default testing. (So Minitest) |
@redbassett could you provide more information? So far, RSpec is known to be broken because RSpec implements |
Apologies! I have the following line of code: It was in place in a test before I upgraded, and passed fine. After the upgrade, I have started getting the following error:
This is despite having the gem installed at version |
@redbassett Could you replicate this in a simple app? |
@jasnow Ah ok. I found out the reason why RSpec isn't working. RSpec doesn't include |
Thanks |
Hmm I can't figure out a good way to support RSpec out of the box as of now. Rails @rafaelfranca Do you have any ideas? Another thing I thought of is to pass the responsibility of including the required modules to |
This gem still don't work |
@asiniy what doesn't work? I need more information than that to help you. |
I use rspec, add
And still have this idiotic exception |
Added a note about usage with RSpec. https://github.com/rails/rails-controller-testing#rspec |
@tgxworld thanks, I'll try it tomorrow ;) |
@tgxworld thanks, works! |
This issue still reproduces for me in apps generated from rails a0a62da2 (i.e. all rails gems at 5.0.0.beta1) and rails-controller-testing v0.0.3. To fix, I put this in my test_helper.rb. class ActionDispatch::IntegrationTest
include Rails::Controller::Testing::TestProcess
end That shouldn't be necessary, right? |
Thanks! (I had ignored that comment because I was looking for a solution for the out-of-the-box Rails tooling, not RSpec. But the work-around is the same.) |
U R Welcome |
Thanks @andrewjanssen , I had the same issue with Rails 5.0.0.beta1 and this gem (0.0.3), your solution works. |
Hmm I think we should add the solution back into the readme for those not running latest RSpec with the fix. |
Fixed for paper-trail-gem/paper_trail#689 test_helper.rb (NOT spec_helper.rb) with the following:
Please consider reopening this issue for discoverability. |
Using minitest and rails-5.0.0.beta2, I found I had to put the following in class ActionDispatch::IntegrationTest
include Rails::Controller::Testing::TestProcess
include Rails::Controller::Testing::TemplateAssertions
include Rails::Controller::Testing::Integration
end That's with version 0.1.0 of the rails-controller-testing gem. |
@jennytech 👋, I see you're using RSpec. The gem requires a bit more config for that setup, make sure you try this from the readme: https://github.com/rails/rails-controller-testing#rspec. Hope that helps! 😁 |
@kaspth Do I need add Useage thoes code also? |
@jennytech you mean the code under Usage? No, you don't have to add anything but the RSpec config to get that error fixed... hopefully 😁 |
I'm on Rails 5.1.4 and rails-controller-testing 1.0.2. I still get the error message "assert_template has been extracted to a gem" from one of my class ActionDispatch::IntegrationTest
include Rails::Controller::Testing::TestProcess
include Rails::Controller::Testing::TemplateAssertions
include Rails::Controller::Testing::Integration
end But this results in |
This issue still persists on rails 5.0.0.1, rspec-rails 3.7.2, and rails-controller-testing 1.0.1:
Add this to your
@tgxworld given the above, maybe you could remove the falsey info from the docs? Clearly, adding the gem to the Gemfile alone is not sufficient :(. |
This issue still seems to be active with Rails 5.1.6, RSpec 3.7.2, and rails-controller-testing 1.0.2. I've tried all the solutions here, and nothing has worked. Here's my spec_helper.rb:
Still I get the following error:
Help! |
On my project it works fine with controller tests, but when I try to use it within a request spec I get:
Versions: rails 5.1.4, rspec-rails 3.7.2, rails-controller-testing 1.0.2 |
Rails 6.0.0.rc1, Ruby 2.6.0p0, still the error persists after adding rails-controller-testing gem
|
+1 |
This worked for me:
|
Adding rails-controller-testing gem to my Rails 5 fork of codeforatlanta's show-me-the-food5 (https://github.com/jasnow/show-me-the-food5) repo's Gemfile does not fix the following message:
gem 'rails-controller-testing'
to your Gemfile.Appears to not be the only one: http://stackoverflow.com/questions/30605868/rails-controller-testing-gem
If you run "rake" before upgrading to the most recent version of Rails 5, no tests break.
After adding the gem rails-controller-testing, running "bundle update", and then running "rake," you get:
The text was updated successfully, but these errors were encountered: