<commit_before>Feature: Manage requests for joining teams
  As a user not currently in a team
  In order to join a team
  I want to be able to send requests to teams, and know their decisions

  Background: There is a team to join
    Given the following teams exist:
      |approved | passcode | submission_id | submitted | declared | pending_requests  |
      |“no”     | “bears1" | 0             | "no"      | "yes"    | 0                 |
      |“no”     | “bears2" | 1             | "no"      | "yes"    | 0                 |
      |“no”     | “bears2" | 2             | "no"      | "yes"    | 0                 |

    And the following users exist
    
      |   name    |       email                       | team      | major             |       sid         |  waitlisted |
      | Tony      |     <EMAIL>             | nil       | Slavic Studies    | 823               | true |
      | An        |    <EMAIL>         | passcode0 | Slavic Studies    | 824               | true |
      | Hezheng   |    <EMAIL>         | passcode1 | Slavic Studies    | 825               | true |
      | George    |    <EMAIL>         | passcode1 | Slavic Studies    | 826               | true |
      | Karl      |    <EMAIL>         | passcode1 | Slavic Studies    | 827               | true |
      | Ken       |    <EMAIL>         | passcode1 | Slavic Studies    | 828               | true |
      | Hadi      |    <EMAIL>               | passcode1 | Slav1c Studies    | 830               | true |
      | Brandon   |    <EMAIL>               | passcode1 | Slav1c Studies    | 831               | true |
      | Sahai     |     <EMAIL>            | passcode2 | Slavic Studies    | 832               | true |
      | Hilfinger |     <EMAIL>             | passcode2 | Slavic Studies    | 833               | true |
      | Papadimitriou |     <EMAIL>         | passcode2 | Slavic Studies    | 834               | true |
      | Fox       |     <EMAIL>              | passcode2 | Slavic Studies    | 835               | true |
      | Patterson |     <EMAIL>              | passcode2 | Slavic Studies    | 836               | true |


    And I am on the new_user page
    And I fill in "Name" with "<NAME>"
    And I fill in "Email" with "<EMAIL>"
    And I fill in "Sid" with "12345678"
    And I select "DECLARED CS/EECS Major" from "major"
    And I choose "user_waitlisted_true"
    And I press "Sign Up"
    And I follow "Team List"

    Scenario: I send a join request to a team that is not full
      Given I press the "Join" button on the same row as "An"
      Then I should see "request sent"
      Given I follow "Requests"
      Then I should see "An"

    Scenario: I send a join request to a team that is full
      Given I press the "Join" button on the same row as "Hezheng"
      Then I should see "Team is Full"

    Scenario: I want to cancel an active join request
      Given I press the "Join" button on the same row as "An"
      Given I press "Requests"
      Given I press the "Cancel" button on the same row as "An"
      Then I should not see "An"

    Scenario: My request was accepted
      Given I press the "Join" button on the same row as "An"
      Given I login as "An"
      Given I press "Requests"
      Given I press the "Accept" button on the same row as "Derek"
      Then I should see "Request Approved"
      Then I should not see "Derek"
      Given I login as "Derek"
      Then I should see "An"

    Scenario: My request was denied
      Given I press the "Join" button on the same row as "An"
      Given I login as "An"
      Given I press "Requests"
      Given I press the "Reject" button on the same row as "Derek"
      Then I should see "Request Approved"
      Then I should not see "Derek"
      Given I login as "Derek"
      Then I should not see "An"

    Scenario: My request was to a team that is full
      Given I create the user:
        |Name   | team_id |
        |Denero | 2       |
      Given I press the "Join" button on the same row as "An"
      Then I should see "Team is now full"<commit_msg>Improved test coverage to 81%<commit_after>Feature: Manage requests for joining teams
  As a user not currently in a team
  In order to join a team
  I want to be able to send requests to teams, and know their decisions

  Background: There is a team to join
    Given the following teams exist:
      |approved | passcode | submission_id | submitted | declared | pending_requests  |
      |“no”     | “bears1" | 0             | "no"      | "yes"    | 0                 |
      |“no”     | “bears2" | 1             | "no"      | "yes"    | 0                 |
      |“no”     | “bears2" | 2             | "no"      | "yes"    | 0                 |

    And the following users exist
    
      |   name    |       email                       | team      | major             |       sid         |  waitlisted |
      | Tony      |     <EMAIL>             | nil       | Slavic Studies    | 823               | true |
      | An        |    <EMAIL>         | passcode0 | Slavic Studies    | 824               | true |
      | Hezheng   |    <EMAIL>         | passcode1 | Slavic Studies    | 825               | true |
      | George    |    <EMAIL>         | passcode1 | Slavic Studies    | 826               | true |
      | Karl      |    <EMAIL>         | passcode1 | Slavic Studies    | 827               | true |
      | Ken       |    <EMAIL>         | passcode1 | Slavic Studies    | 828               | true |
      | Hadi      |    <EMAIL>               | passcode1 | Slav1c Studies    | 830               | true |
      | Brandon   |    <EMAIL>               | passcode1 | Slav1c Studies    | 831               | true |
      | Sahai     |     <EMAIL>            | passcode2 | Slavic Studies    | 832               | true |
      | Hilfinger |     <EMAIL>             | passcode2 | Slavic Studies    | 833               | true |
      | Papadimitriou |     <EMAIL>         | passcode2 | Slavic Studies    | 834               | true |
      | Fox       |     <EMAIL>              | passcode2 | Slavic Studies    | 835               | true |
      | Patterson |     <EMAIL>              | passcode2 | Slavic Studies    | 836               | true |


    And I am on the new_user page
    And I fill in "Name" with "<NAME>"
    And I fill in "Email" with "<EMAIL>"
    And I fill in "Sid" with "12345678"
    And I select "DECLARED CS/EECS Major" from "major"
    And I choose "user_waitlisted_true"
    And I press "Sign Up"
    And I follow "Team List"

    Scenario: I send a join request to a team that is not full
      Given I press the "Join" button on the same row as "An"
      Then I should see "Request Sent"
      Given I follow "Requests"
      Then I should see "An"

    Scenario: I send a join request to a team that is full
      Given I press the "Join" button on the same row as "Hezheng"
      Then I should see "Team is Full"

    Scenario: I want to cancel an active join request
      Given I press the "Join" button on the same row as "An"
      And I follow "Requests"
      And I press the "Cancel" button on the same row as "An"
      Then I should not see "An"

    Scenario: My request was accepted
      Given I press the "Join" button on the same row as "An"
      And I login as "An"
      And I press "Requests"
      And I press the "Accept" button on the same row as "Derek"
      Then I should see "Request Approved"
      And I should not see "Derek"
      Given I login as "Derek"
      Then I should see "An"

    Scenario: My request was denied
      Given I press the "Join" button on the same row as "An"
      Given I login as "An"
      Given I press "Requests"
      Given I press the "Reject" button on the same row as "Derek"
      Then I should see "Request Approved"
      Then I should not see "Derek"
      Given I login as "Derek"
      Then I should not see "An"
{'fraction_non_alphanumeric': 0.07375904532182304, 'fraction_numerical': 0.018154119588675893, 'mean_word_length': 1.4427906976744187, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5203728', 'n_tokens_mistral': 2367, 'n_tokens_neox': 2235, 'n_words': 956}