From bedd29f7e836eb1631b5b32bc3c592ecaf1e5376 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 20 Aug 2022 21:18:25 +0200 Subject: [PATCH] Add base spec for `Moderation::ReportsController` --- .../moderation/reports_controller_spec.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spec/controllers/moderation/reports_controller_spec.rb diff --git a/spec/controllers/moderation/reports_controller_spec.rb b/spec/controllers/moderation/reports_controller_spec.rb new file mode 100644 index 00000000..1c4389e1 --- /dev/null +++ b/spec/controllers/moderation/reports_controller_spec.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require "rails_helper" + +describe Moderation::ReportsController, type: :controller do + let(:user) { FactoryBot.create :user, roles: ["moderator"] } + + describe "#index" do + subject { get :index } + + before do + sign_in user + end + + it "renders the user/questions template" do + subject + expect(response).to render_template("moderation/reports/index") + end + end +end