require "rails_helper"
RSpec.describe GadgetsController do
describe "GET #index" do
subject { get :index }
it "renders the index template" do
expect(subject).to render_template(:index)
expect(subject).to render_template("index")
expect(subject).to render_template("gadgets/index")
end
it "does not render a different template" do
expect(subject).to_not render_template("gadgets/show")
end
end
end

require "rails_helper"
RSpec.describe "gadgets/index" do
it "renders the index template" do
assign(:gadgets, [Gadget.create!])
render
expect(view).to render_template(:index)
expect(view).to render_template("index")
expect(view).to render_template("gadgets/index")
end
it "does not render a different template" do
expect(view).to_not render_template("gadgets/show")
end
end