<commit_before>Feature: Manage teammate advertisements

Background:
  Given I am logged in as a student
    And a student with the username "student1" exists
    And a student with the username "student2" exists
  Given I am participating in team assignment "my_assignment"
    And assignment named "my_assignment" has a topic with name "test_topic"

  Scenario: Create an advertisement
  Given I have a team with name "my_team" in assignment "my_assignment"
  When I click on "Assignments"
  Then I click on "my_assignment"
   And I click on "Your team"
   And I click on "new"
  Then I fill in "Please describe the qualifications you are looking for in a teammate." with "No more than 200 pounds."
   And I press "Create"
  Then I should see "No more than 200 pounds."

Scenario: Edit an advertisement
  Given I have a team with name "my_team" in assignment "my_assignment"
  Given I have created an advertisement
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Your team"
   Then I click on "edit"
    And I fill in "Please describe the qualifications you are looking for in a teammate." with "I wanna edit my ad."
    And I press "Update"
   Then I should see "I wanna edit my ad."

Scenario: Destroy an advertisement
  Given I have a team with name "my_team" in assignment "my_assignment"
  Given I have created an advertisement
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Your team"
    And I click on "destroy"
   Then I should not see "This is my ad."

Scenario: Respond to an advertisement when I am not on a team
   Given a team named "test_team" has an ad with desired qualities "I need a teammate."
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Signup sheet"
    And I click on ad icon
   Then I should see "I need a teammate."


Scenario: Respond to an advertisement when I am on a team
  Given I have a team with name "my_team" in assignment "my_assignment"

Scenario: Decline join team request
  Given a team named "test_team" has an ad with desired qualities "I need a teammate."
  Given I sent a join_team request to ad "I need a teammate."
    And the team sent me an invitation
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Your team"
   When I decline the invitation
   Then I should not see "student1"

Scenario: Inviting a respondent to join a full team should not fail
  Given I have a team with name "my_team" in assignment "my_assignment"
    And I have created an advertisement
  Given student "student1" sent me a join_team request
    But my team is full
   When I visit the page of "Your team"
   Then I should see "This is my ad."
  Then I fill in "user_name" with "student1"
   When I press "Invite"
   Then I should not see "The team already has the maximum number of members."

Scenario: Inviting a respondent to join a non-full team should pass
  Given I have a team with name "my_team" in assignment "my_assignment"
    And I have created an advertisement
  Given student "student1" sent me a join_team request
    And my team is not full
   When I visit the page of "Your team"
   Then I should see "This is my ad."
   When I press "Invite"
   Then I should see "Waiting for reply"

Scenario: Send multiple requests to join a team should be updated
  Given I have a team with name "my_team" in assignment "my_assignment"
    And I have created an advertisement
   When student "student1" sent me several join_team requests
    And I visit the page of "Your team"
   Then I should only see the latest request<commit_msg>Made a fix to one of the scenarios in advertisements<commit_after>Feature: Manage teammate advertisements

Background:
  Given I am logged in as a student
    And a student with the username "student1" exists
    And a student with the username "student2" exists
  Given I am participating in team assignment "my_assignment"
    And assignment named "my_assignment" has a topic with name "test_topic"

  Scenario: Create an advertisement
  Given I have a team with name "my_team" in assignment "my_assignment"
  When I click on "Assignments"
  Then I click on "my_assignment"
   And I click on "Your team"
   And I click on "new"
  Then I fill in "Please describe the qualifications you are looking for in a teammate." with "No more than 200 pounds."
   And I press "Create"
  Then I should see "No more than 200 pounds."

Scenario: Edit an advertisement
  Given I have a team with name "my_team" in assignment "my_assignment"
  Given I have created an advertisement
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Your team"
   Then I click on "edit"
    And I fill in "Please describe the qualifications you are looking for in a teammate." with "I wanna edit my ad."
    And I press "Update"
   Then I should see "I wanna edit my ad."

Scenario: Destroy an advertisement
  Given I have a team with name "my_team" in assignment "my_assignment"
  Given I have created an advertisement
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Your team"
    And I click on "destroy"
   Then I should not see "This is my ad."

Scenario: Respond to an advertisement when I am not on a team
   Given a team named "test_team" has an ad with desired qualities "I need a teammate."
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Signup sheet"
    And I click on ad icon
   Then I should see "I need a teammate."


Scenario: Respond to an advertisement when I am on a team
  Given I have a team with name "my_team" in assignment "my_assignment"

Scenario: Decline join team request
  Given a team named "test_team" has an ad with desired qualities "I need a teammate."
  Given I sent a join_team request to ad "I need a teammate."
    And the team sent me an invitation
   When I click on "Assignments"
    And I click on "my_assignment"
    And I click on "Your team"
   When I decline the invitation
   Then I should not see "student1"

Scenario: Inviting a respondent to join a full team should not fail
  Given I have a team with name "my_team" in assignment "my_assignment"
    And I have created an advertisement
  Given student "student1" sent me a join_team request
    But my team is full
   When I visit the page of "Your team"
   Then I should see "This is my ad."
  Then I fill in "user_name" with "student1"
   When I press "Invite"
   Then I should not see "The team already has the maximum number of members."

Scenario: Inviting a respondent to join a non-full team should pass
  Given I have a team with name "my_team" in assignment "my_assignment"
    And I have created an advertisement
  Given student "student1" sent me a join_team request
    And my team is not full
   When I visit the page of "Your team"
   Then I should see "This is my ad."
  Then I fill in "user_name" with "student1"
   When I press "Invite"
   Then I should see "Waiting for reply"

Scenario: Send multiple requests to join a team should be updated
  Given I have a team with name "my_team" in assignment "my_assignment"
    And I have created an advertisement
   When student "student1" sent me several join_team requests
    And I visit the page of "Your team"
   Then I should only see the latest request
{'fraction_non_alphanumeric': 0.045020463847203276, 'fraction_numerical': 0.0036834924965893586, 'mean_word_length': 3.418927064496685, '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': '3310012', 'n_tokens_mistral': 2096, 'n_tokens_neox': 2029, 'n_words': 1205}