Skip to content

Commit

Permalink
AO3-5054 Move test(s) to kudos.feature
Browse files Browse the repository at this point in the history
  • Loading branch information
irrationalpie7 committed Mar 30, 2024
1 parent 60e925b commit bc0af83
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
21 changes: 21 additions & 0 deletions features/comments_and_kudos/kudos.feature
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,24 @@ Feature: Kudos
When I am logged in as "pest"
And I view the work "Aftermath"
Then I should not see a "Kudos ♥" button

Scenario: Kudos cache expires periodically to ensure deleted users are removed and renamed users are updated
Given the work "Interesting beans"
And I am logged in as "oldusername1" with password "password"
When I view the work "Interesting beans"
And I press "Kudos ♥"
Then I should see "oldusername1 left kudos on this work!"
When I visit the change username page for oldusername1
And I fill in "New user name" with "newusername1"
And I fill in "Password" with "password"
And I press "Change User Name"
Then I should get confirmation that I changed my username
And I should see "Hi, newusername1"
When the kudos cache has expired
And I view the work "Interesting beans"
Then I should see "newusername1 left kudos on this work!"
And I should not see "oldusername1"
When I try to delete my account as newusername1
And the kudos cache has expired
And I view the work "Interesting beans"
Then I should not see "newusername1 left kudos on this work!"
11 changes: 0 additions & 11 deletions features/users/user_delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,3 @@ Scenario: Delete a user who has coauthored a work
And a user account should not exist for "testuser"
When I go to orphan_account's series page
Then I should see "Epic"

Scenario: Deleting user updates kudos fragment
Given the work "SUPER Interesting"
And I am logged in as "kudoser"
When I view the work "SUPER Interesting"
And I press "Kudos ♥"
Then I should see "kudoser left kudos on this work!"
When I try to delete my account as kudoser
And the kudos cache has expired
And I view the work "SUPER Interesting"
Then I should not see "kudoser left kudos on this work!"
19 changes: 1 addition & 18 deletions features/users/user_rename.feature
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,6 @@ Feature:
When I follow "Series"
Then I should see "Best Series by newusername"

Scenario: Changing username updates kudos fragment
Given the work "Interesting beans"
And I am logged in as "oldusername1" with password "password"
When I view the work "Interesting beans"
And I press "Kudos ♥"
Then I should see "oldusername1 left kudos on this work!"
When I visit the change username page for oldusername1
And I fill in "New user name" with "newusername1"
And I fill in "Password" with "password"
And I press "Change User Name"
Then I should get confirmation that I changed my username
And I should see "Hi, newusername1"
When the kudos cache has expired
And I view the work "Interesting beans"
Then I should see "newusername1 left kudos on this work!"
And I should not see "oldusername1"

Scenario: Changing the username from a forbidden name to non-forbidden
Given I have no users
And the following activated user exists
Expand All @@ -227,4 +210,4 @@ Feature:
And I fill in "Password" with "secret"
And I press "Change User Name"
Then I should get confirmation that I changed my username
And I should see "Hi, notforbidden"
And I should see "Hi, notforbidden"

0 comments on commit bc0af83

Please sign in to comment.