<commit_before># Iter 3-1
@javascript
Feature: User should be able to edit their previous pups' ratings
    As a user
    I want to modify my dog ratings
    So that when I make a mistake or change my mind, I can edit the ratings
    
Background: User already login
  Given the default layout exist
  Given I am on the RateMyPup home page
  
  And the following users exist: 
    | username       | email               | password       | password_confirmation| activated |
    | jeff           | <EMAIL>   | 12345678       | 12345678             | true      |
    | gilbert        | <EMAIL>| 12345678       | 12345678             | true      |

  And the following breeds exist:
    | name            | 
    | Affenpinscher   |
    | <NAME>    |
    | Akita           |
    | Chan            |
  
  And the following breeders exist:
    | name            | city     | state |
    | Unknown         |          |       |
    | Carl            | Berkeley | CA    |
    | Juju            | Berkeley | CA    |

  And the following pups exist:
    | pup_name        | breeder_id  | breed_id | user_id | breeder_responsibility | overall_health | trainability | dog_behavior    | social_behavior | energy_level | simpatico_rating | year | month |
    | dog1            | 3           | 2        | 1       | 4                      | 4              | 3            | 2               | 5               | 3            | 4                | 1    | 1     |
    | dog2            | 1           | 1        | 1       | 4                      | 4              | 3            | 2               | 5               | 3            | 4                | 1    | 1     |
    | dog3            | 2           | 3        | 2       | 3                      | 4              | 3            | 2               |4                | 4            | 3                | 1    | 1     |
  
  And   I should not see "My Pups"
  
  Given I log in as "jeff"
  When I click the nav bar dropdown button
  And I follow "My Pups"
  Then  I should be on the "Pups Ratings" page
  
  Scenario: users can see pups ratings
    And   I should see "dog1"
    And   I should see "dog2"
    And   I should not see "dog3"
  
  Scenario: users can delete ratings 
    When  I follow "Delete" for dog1
    Then  I should be on the "Pups Ratings" page
    And   I should see "Pup dog1 has been deleted"
    When  I am on the "Pups Ratings" page
    Then  I should not see "dog1"'s basic info
    And   I should see "dog2"'s basic info
    
  Scenario: users can edit ratings
    When  I follow "Edit" for dog1
    Then  I should be on the "Edit Pup Rating" page
    When  I fill in new info
    And   I press "Update"
    And I wait for 2 seconds
    Then  I should be on the "Pups Ratings" page
    And   I should see "Pup has been updated"
    When  I follow "More" for dog1
    Then  I should see correct info updated
    
  Scenario: users can cancel the edit before saving
    When  I follow "Edit" for dog1
    And   I fill in new info
    And   I follow "Cancel"
    And I wait for 2 seconds
    Then  I should be on the "Pups Ratings" page
    When  I follow "More" for dog1
    Then  I should see correct info of dog1
    
  Scenario: users can add breeder if he wants
    When  I follow "Edit" for dog1
    And   I fill in with a non-existing breeder
    And   I press "Update"
    Then  I should be on the "Edit Pup Rating" page
    And   I should see "The breeder you enter is not in our database" 
    When  I follow "Add Breeder"
    And I wait for 2 seconds
    Then  I should be on the "Add breeder" page
    When  I finish adding a new breeder 
    Then  I should be on the "Edit Pup Rating" page
    And   I should see "Breeder has been updated!"
  
  Scenario: users can go to details page and delete pup
    When  I follow "More" for dog1
    Then  I should be on the "Pup Rating Detail" page
    And   I should see correct info of dog1
    When  I press "Delete pup"
    And I wait for 2 seconds
    Then  I should be on the "Pups Ratings" page
    And   I should see "Pup dog1 has been deleted"
    When  I am on the "Pups Ratings" page
    Then  I should not see "dog1"
    And   I should see "dog2"'s rating    
    
  Scenario: users can go to details page and edit pup
    When  I follow "More" for dog1
    When  I press "Edit pup"
    And I wait for 2 seconds
    Then  I should be on the "Edit Pup Rating" page
#End iter 3-1<commit_msg>maint:  change edit_pup "more" to "view"<commit_after># Iter 3-1
@javascript
Feature: User should be able to edit their previous pups' ratings
    As a user
    I want to modify my dog ratings
    So that when I make a mistake or change my mind, I can edit the ratings
    
Background: User already login
  Given the default layout exist
  Given I am on the RateMyPup home page
  
  And the following users exist: 
    | username       | email               | password       | password_confirmation| activated |
    | jeff           | <EMAIL>   | 12345678       | 12345678             | true      |
    | gilbert        | <EMAIL>| 12345678       | 12345678             | true      |

  And the following breeds exist:
    | name            | 
    | Affenpinscher   |
    | <NAME>    |
    | Akita           |
    | Chan            |
  
  And the following breeders exist:
    | name            | city     | state |
    | Unknown         |          |       |
    | Carl            | Berkeley | CA    |
    | Juju            | Berkeley | CA    |

  And the following pups exist:
    | pup_name        | breeder_id  | breed_id | user_id | breeder_responsibility | overall_health | trainability | dog_behavior    | social_behavior | energy_level | simpatico_rating | year | month |
    | dog1            | 3           | 2        | 1       | 4                      | 4              | 3            | 2               | 5               | 3            | 4                | 1    | 1     |
    | dog2            | 1           | 1        | 1       | 4                      | 4              | 3            | 2               | 5               | 3            | 4                | 1    | 1     |
    | dog3            | 2           | 3        | 2       | 3                      | 4              | 3            | 2               |4                | 4            | 3                | 1    | 1     |
  
  And   I should not see "My Pups"
  
  Given I log in as "jeff"
  When I click the nav bar dropdown button
  And I follow "My Pups"
  Then  I should be on the "Pups Ratings" page
  
  Scenario: users can see pups ratings
    And   I should see "dog1"
    And   I should see "dog2"
    And   I should not see "dog3"
  
  Scenario: users can delete ratings 
    When  I follow "Delete" for dog1
    Then  I should be on the "Pups Ratings" page
    And   I should see "Pup dog1 has been deleted"
    When  I am on the "Pups Ratings" page
    Then  I should not see "dog1"'s basic info
    And   I should see "dog2"'s basic info
    
  Scenario: users can edit ratings
    When  I follow "Edit" for dog1
    Then  I should be on the "Edit Pup Rating" page
    When  I fill in new info
    And   I press "Update"
    And I wait for 2 seconds
    Then  I should be on the "Pups Ratings" page
    And   I should see "Pup has been updated"
    When  I follow "View" for dog1
    Then  I should see correct info updated
    
  Scenario: users can cancel the edit before saving
    When  I follow "Edit" for dog1
    And   I fill in new info
    And   I follow "Cancel"
    And I wait for 2 seconds
    Then  I should be on the "Pups Ratings" page
    When  I follow "View" for dog1
    Then  I should see correct info of dog1
    
  Scenario: users can add breeder if he wants
    When  I follow "Edit" for dog1
    And   I fill in with a non-existing breeder
    And   I press "Update"
    Then  I should be on the "Edit Pup Rating" page
    And   I should see "The breeder you enter is not in our database" 
    When  I follow "Add Breeder"
    And I wait for 2 seconds
    Then  I should be on the "Add breeder" page
    When  I finish adding a new breeder 
    Then  I should be on the "Edit Pup Rating" page
    And   I should see "Breeder has been updated!"
  
  Scenario: users can go to details page and delete pup
    When  I follow "View" for dog1
    Then  I should be on the "Pup Rating Detail" page
    And   I should see correct info of dog1
    When  I press "Delete pup"
    And I wait for 2 seconds
    Then  I should be on the "Pups Ratings" page
    And   I should see "Pup dog1 has been deleted"
    When  I am on the "Pups Ratings" page
    Then  I should not see "dog1"
    And   I should see "dog2"'s rating    
    
  Scenario: users can go to details page and edit pup
    When  I follow "View" for dog1
    When  I press "Edit pup"
    And I wait for 2 seconds
    Then  I should be on the "Edit Pup Rating" page
#End iter 3-1
{'fraction_non_alphanumeric': 0.04994903160040775, 'fraction_numerical': 0.022426095820591234, 'mean_word_length': 1.497878359264498, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4978757', 'n_tokens_mistral': 2732, 'n_tokens_neox': 2544, 'n_words': 1216}