<commit_before>RSpec.shared_examples "protected branches > access control > CE" do
  ProtectedBranch::PushAccessLevel.human_access_levels.each do |(access_type_id, access_type_name)|
    it "allows creating protected branches that #{access_type_name} can push to" do
      visit namespace_project_protected_branches_path(project.namespace, project)

      set_protected_branch_name('master')

      within('.new_protected_branch') do
        allowed_to_push_button = find(".js-allowed-to-push")

        unless allowed_to_push_button.text == access_type_name
          allowed_to_push_button.click
          within(".dropdown.open .dropdown-menu") { click_on access_type_name }
        end
      end

      click_on "Protect"

      expect(ProtectedBranch.count).to eq(1)
      expect(ProtectedBranch.last.push_access_levels.map(&:access_level)).to eq([access_type_id])
    end

    it "allows updating protected branches so that #{access_type_name} can push to them" do
      visit namespace_project_protected_branches_path(project.namespace, project)

      set_protected_branch_name('master')

      click_on "Protect"

      expect(ProtectedBranch.count).to eq(1)

      within(".protected-branches-list") do
        find(".js-allowed-to-push").click
        
        within('.js-allowed-to-push-container') do
          expect(first("li")).to have_content("Roles")
          click_on access_type_name
        end
      end<commit_msg>Another change from .click -> .trigger('click') to make spec pass<commit_after>RSpec.shared_examples "protected branches > access control > CE" do
  ProtectedBranch::PushAccessLevel.human_access_levels.each do |(access_type_id, access_type_name)|
    it "allows creating protected branches that #{access_type_name} can push to" do
      visit namespace_project_protected_branches_path(project.namespace, project)

      set_protected_branch_name('master')

      within('.new_protected_branch') do
        allowed_to_push_button = find(".js-allowed-to-push")

        unless allowed_to_push_button.text == access_type_name
          allowed_to_push_button.trigger('click')
          within(".dropdown.open .dropdown-menu") { click_on access_type_name }
        end
      end

      click_on "Protect"

      expect(ProtectedBranch.count).to eq(1)
      expect(ProtectedBranch.last.push_access_levels.map(&:access_level)).to eq([access_type_id])
    end

    it "allows updating protected branches so that #{access_type_name} can push to them" do
      visit namespace_project_protected_branches_path(project.namespace, project)

      set_protected_branch_name('master')

      click_on "Protect"

      expect(ProtectedBranch.count).to eq(1)

      within(".protected-branches-list") do
        find(".js-allowed-to-push").click
        
        within('.js-allowed-to-push-container') do
          expect(first("li")).to have_content("Roles")
          click_on access_type_name
        end
      end
{'fraction_non_alphanumeric': 0.09724583475008501, 'fraction_numerical': 0.0013600816048962938, 'mean_word_length': 3.4916030534351146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6437484', 'n_tokens_mistral': 869, 'n_tokens_neox': 845, 'n_words': 165}