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

undefined method `controller' for RSpec::ExampleGroups::PaymentIQPaymentIQController:Class #1037

Closed
mhenrixon opened this issue May 24, 2014 · 5 comments

Comments

@mhenrixon
Copy link
Contributor

Hi again,

First of all many thanks for the RC1 release. Look forward to upgrade all my projects to use it.

I run in to the error message in the title any time I try to do something fancy in a controller spec.

controller do
    before_filter :ensure_player_exists
    before_filter :ensure_session_exists, only: [:create]

    def index
      render :text => 'index called'
    end

    def create
      render :text => 'create called'
    end
  end

Not sure why this broke between beta2 and rc1. Any suggestions? I don't see the controller { } macro being deprecated anywhere.

@JonRowe
Copy link
Member

JonRowe commented May 24, 2014

Probably your using inferred controller specs and missed the deprecation, tag your spec with type: :controller or enable inferred specs.

@mhenrixon
Copy link
Contributor Author

Aha so I figured it out, RSpec stopped working for sub folders. If I have a spec like /spec/controllers/v1/receipts_controller_spec it isn't picked up as a controller spec anymore. If I add :type => :controller it works.

Is that how it should be?

@JonRowe
Copy link
Member

JonRowe commented May 24, 2014

Yep.

@JonRowe
Copy link
Member

JonRowe commented May 24, 2014

You can enable the deprecated behaviour with RSpec.configuration.infer_spec_type_from_file_location!

@mhenrixon
Copy link
Contributor Author

Awesome thanks @JonRowe

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