I'm starting to learn RSpec from a tutorial.
I'm stuck on tests for the controller.
For some reason, I can’t run the next test in my application:
require "rails_helper"
RSpec.describe PostsController, type: :controller do
context "GET #index" do
it "returns a success response" do
get :index
expect(response).to be_success
end
end
end
I get the error:
ActionView::Template::Error:
wrong number of arguments (given 2, expected 1)
# ./spec/controllers/posts_controller_spec.rb:6:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# ArgumentError:
# wrong number of arguments (given 2, expected 1)
# ./spec/controllers/posts_controller_spec.rb:6:in `block (3 levels) in <top (required)>'
I don’t understand what could be the problem, because in the tutorial it works.