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

8fbc9bc breaks Rails (v4.2.1) controller specs #70

Closed
psynix opened this issue May 28, 2015 · 4 comments
Closed

8fbc9bc breaks Rails (v4.2.1) controller specs #70

psynix opened this issue May 28, 2015 · 4 comments

Comments

@psynix
Copy link

psynix commented May 28, 2015

Commit: 8fbc9bc

It appears this commit breaks Rails (v4.2.1) controller specs. Minimal example:

require 'rails_helper'

RSpec.describe PagesController, type: :controller do
  describe 'GET #home' do
    it 'returns http success' do
      get :home
      expect(response).to have_http_status(:success)
    end
  end
end

Error returned:

Failure/Error: get :home
     RuntimeError:
       @controller is nil: make sure you set it in your test's setup method.
     # ./spec/controllers/pages_controller_spec.rb:7:in `block (3 levels) in <top (required)>'
@apotonick
Copy link
Member

If that breaks controller specs, than something is terribly wrong! The ExampleGroup for cells is only mixed into cell specs - or at least, that's what I thought is happening.

Check that: https://github.com/apotonick/rspec-cells/blob/4b6a1a4d4d4da82d96998616c2f67b1326038b99/lib/rspec/cells/example_group.rb#L57

I am not an expert on Rspec, that's why I need your help here!

@apotonick
Copy link
Member

AAAaaah I'm an idiot. That's the third time this week that I am an idiot! https://github.com/apotonick/rspec-cells/blob/4b6a1a4d4d4da82d96998616c2f67b1326038b99/lib/rspec/cells/example_group.rb#L63

@psynix
Copy link
Author

psynix commented May 28, 2015

Wow. Too quick for me ☺

Thank you so much for your prompt response.

@apotonick
Copy link
Member

Thanks for your prompt report: https://twitter.com/apotonick/status/603846298253549569

😝

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