I have a brand new rails 6 application, and I installed rspec.
I created a controller, and when I run rspec I get this error:
PagesController GET #index returns http success Failure/Error: get :index ActionView::Template::Error: wrong number of arguments (given 2, expected 1) # ./spec/controllers/pages_controller_spec.rb:7:in `block (3 levels) in <top (required)>' # ------------------ # --- Caused by: --- # ArgumentError: # wrong number of arguments (given 2, expected 1) # ./spec/controllers/pages_controller_spec.rb:7:in `block (3 levels) in <top (required)>'
The generated rspec test looks like:
require 'rails_helper'
RSpec.describe CartController, type: :controller do
describe "GET #index" do
it "returns http success" do
get :index
expect(response).to have_http_status(:success)
end
end
end
Is there a bug in the generated code or is some other environmental issue the cause of this?
I don't see where there are 2 arguments anywhere?