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
Rails 5/RSpec/Device - method_missing: undefined method setup #4189
Comments
See if you have the "setup" script in your repo's "bin" directory. |
I have setup script with content:
|
@Blazy7 can you please provide a sample app that reproduces the error? This sound like a possible issue with the controller test setup. |
I've also hit this with devise 4.2.0, rails 5.0.0 and rspec-rails 3.5.1. This occurs when trying to run my controller specs. Rolling back to devise 4.1.0 and changing This could be an issue with the additional module nesting. setup is defined in the Devise module (line 291), and doesn't seem to be available in the Devise::Test::ControllerHelpers namespace. |
devise 4.2.0 I write some controller helper for controller test.
in rails_helper.rb,
when call this line, this issue occured. |
Same issue as @zephiransas. In my mycontroller_controller_spec.rb : devise 4.2.0 If I rollback to devise 4.1.1, this issue disappears. |
@zephiransas @Blaked84 in those cases you shouldn't include the module inside another directly, but use your module ControllerHelpers
extend ActiveSupport::Concern
included do
include Devise::Test::ControllerHelpers
end
end But it could be something else on your test setup that's breaking with the controller helpers, in that case, please provide a sample app with quick steps to reproduce the error otherwise we will be spitballing here forever. I'm closing this issue as we might have different problems going around here, so if you got a sample app of the issue you are facing please open a new issue with the app's URL. |
@lucasmazza That works well for me. Thx! |
Was bitten by this on upgrading devise from 4.1.1 to 4.2.0. Resolved it by merging rspec config from Because it's specified in https://github.com/plataformatec/devise#controller-tests, "Just be sure that this inclusion is made after the require 'rspec/rails' directive." |
@lucasmazza I made a quick sample app as you suggested, exhibiting the Hope that helps! Would love to get this solved. |
@sgoldens your sample app does not require |
This also happens if |
I've had this issue as well and ended up on this page from Google. For my application there were 2 locations where It's unclear to me if it's the duplication causing the issue, or the ordering as @jessethebuilder suggested above. |
Hello, after upgrade from Rails 5.0.0rc1 to Rails 5.0.0 and try to
bundle exec rspec spec/
i get errormethod_missing': undefined method
setup'Gemfile:
Any help will be appreciated. Thanks.
The text was updated successfully, but these errors were encountered: