From 094e2172ec6243141eabc79cfcc8c1d633a331ac Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 10 Dec 2024 18:08:14 -0500 Subject: [PATCH] Add system spec for `Admin::TermsOfService` index view (#33250) --- spec/system/admin/terms_of_service_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/system/admin/terms_of_service_spec.rb diff --git a/spec/system/admin/terms_of_service_spec.rb b/spec/system/admin/terms_of_service_spec.rb new file mode 100644 index 0000000000..d6ee1469d2 --- /dev/null +++ b/spec/system/admin/terms_of_service_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Admin Terms of services' do + describe 'Viewing terms of services index page' do + let!(:terms) { Fabricate :terms_of_service, text: 'Test terms' } + + before { sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } + + it 'allows tags listing and editing' do + visit admin_terms_of_service_index_path + + expect(page) + .to have_title(I18n.t('admin.terms_of_service.title')) + + expect(page) + .to have_content(terms.text) + end + end +end