<commit_before>require 'rails_helper'
require 'dashboard'

RSpec.describe "Low carbon hub management", :low_carbon_hub_installations, type: :system do
  include_context "low carbon hub data"

  let!(:school_admin) { create(:user, role: 'school_admin', school_id: school.id) }

  context 'as school admin' do
    before(:each) do
      sign_in(school_admin)
      visit root_path

      click_on 'Manage Low carbon hub installations'
      expect(page).to have_content("There are no Low carbon hub installations at the moment for this school")
      click_on 'New Low carbon hub installation'
    end<commit_msg>Only admins can manage low carbon hub installations<commit_after>require 'rails_helper'
require 'dashboard'

RSpec.describe "Low carbon hub management", :low_carbon_hub_installations, type: :system do
  include_context "low carbon hub data"

  let!(:admin) { create(:user, role: :admin) }

  context 'as an admin' do
    before(:each) do
      sign_in(admin)
      visit school_path(school)

      click_on 'Manage Low carbon hub installations'
      expect(page).to have_content("There are no Low carbon hub installations at the moment for this school")
      click_on 'New Low carbon hub installation'
    end
{'fraction_non_alphanumeric': 0.08183306055646482, 'fraction_numerical': 0.0, 'mean_word_length': 4.294372294372295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4503275', 'n_tokens_mistral': 359, 'n_tokens_neox': 343, 'n_words': 126}