From 930e16bbda721d6ad79ef181a426b7535f477cc1 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 20 Nov 2022 19:35:11 +0100 Subject: [PATCH] Add tests for `Admin::DashboardController` --- .../admin/dashboard_controller_spec.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spec/controllers/admin/dashboard_controller_spec.rb diff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rb new file mode 100644 index 00000000..74066c17 --- /dev/null +++ b/spec/controllers/admin/dashboard_controller_spec.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require "rails_helper" + +describe Admin::DashboardController, type: :controller do + describe "#index" do + subject { get :index } + + context "user signed in" do + let(:user) { FactoryBot.create(:user, roles: [:administrator]) } + + before { sign_in user } + + it "shows the index page" do + subject + expect(response).to have_rendered(:index) + end + end + end +end