Closed haslinger closed 8 years ago
OK, I found a workaround: Fixing Rspec to 3.3.0. I'm not sure, if somebody wants to look into this, I would be fine with closing the issue.
I have reproduced this issue. The problem was introduced by this change in rspec-rails: https://github.com/rspec/rspec-rails/commit/80637fc9ff26a4ae7b80ce96a3aa8fcc744faea2
So you can actually use rspec
3.4.0, but you need rspec-rails
3.4.0, instead of 3.4.2:
gem 'rspec-rails', '= 3.4.0'
gem 'rspec', '= 3.4.0'
The origin of this issue is that Rspec hacks the template rendering system in order to run controller tests faster, without rendering the views. After a Rails upgrade, their hack broke and they rewrote it. But that new hack is not working with Hobo.
I'm sure we could fix in our side with enough time, but I think we can live for now by avoiding that hack. We can use render_views
with the latest rspec versions and it seems to work perfectly fine:
gem 'rspec-rails', '= 3.4.2'
gem 'rspec', '= 3.4.0'
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
render_views
describe "GET index" do
it "assigns @example" do
get :index
expect(assigns(:example)).to eq([1,2,3])
end
end
end
I am using rspec 3.4.0 to test my app. Whenever I call a crud method in a controller spec, e.g.
get :index
I get the error message:ArgumentError: path already is a Resolver class
I typical stack trace would look like this:
Currently, I have no idea how to fix this.
Update: I was concerned, that the searchkick call in the stacktrace could be a reason, so I removed searchkick from my app, same issue.