trailblazer / rspec-cells

Spec your Cells.
http://cells.rubyforge.org
MIT License
62 stars 48 forks source link

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

Closed psynix closed 9 years ago

psynix commented 9 years ago

Commit: 8fbc9bc19d69a3e47e477e4d0da661e911694ec7

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

Wow. Too quick for me ☺

Thank you so much for your prompt response.

apotonick commented 9 years ago

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

:stuck_out_tongue_closed_eyes: