Skip to content
This repository
tree: 0f1cffdeac
Fetching contributors…

Cannot retrieve contributors at this time

file 135 lines (121 sloc) 5.142 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
Feature: Leave kudos
In order to show appreciation
As a reader
I want to leave kudos

Background:
Given the following activated users exist
| login | email |
| myname1 | myname1@foo.com |
| myname2 | myname2@foo.com |
| myname3 | myname3@foo.com |
And I am logged in as "myname1"
And I post the work "Awesome Story"
And I log out


Scenario: post kudos

When I am logged in as "myname2"
And all emails have been delivered
And I view the work "Awesome Story"
Then I should not see "left kudos on this work"
# Note: this step cannot be put into the steps file because of the heart character
When I press "Kudos ♥"
Then I should see "myname2 left kudos on this work!"
# make sure no emails go out until notifications are sent
And 0 emails should be delivered
When kudos are sent
Then 1 email should be delivered to "myname1@foo.com"
And the email should contain "myname2"
And the email should contain "left kudos"
And the email should contain "."
And the email should not contain "!"
And all emails have been delivered
When I press "Kudos ♥"
Then I should see "You have already left kudos here. :)"
And I should not see "myname2 and myname2 left kudos on this work!"
When I log out
And I press "Kudos ♥"
And kudos are sent
Then 1 email should be delivered to "myname1@foo.com"
And the email should contain "A guest"
And the email should contain "left kudos"
And the email should contain "."
And the email should not contain "!"
Then I should see "Thank you for leaving kudos!"
# guest kudos don't show up immediately
# Then I should see "myname2 as well as a guest left kudos on this work!"
When I press "Kudos ♥"
Then I should see "You have already left kudos here. :)"
When I am logged in as "myname3"
And I view the work "Awesome Story"
And I press "Kudos ♥"
# guest kudos don't show up immediately
# Then I should see "myname3 and myname2 as well as a guest left kudos on this work!"
Then I should see "myname3 and myname2 left kudos on this work!"
When I am logged in as "myname1"
And I view the work "Awesome Story"
Then I should not see "Kudos ♥"
# Then I should see "You can't leave kudos for yourself. :)"

Scenario: kudos on a multi-chapter work
When I am logged in as "myname1"
And I post the chaptered work "Epic Saga"
And I follow "Add Chapter"
And I fill in "content" with "third chapter is a draft"
And I press "Preview"
When I am logged in as "myname3"
And I view the work "Epic Saga"
And I press "Kudos ♥"
Then I should see kudos on every chapter
When I am logged in as "myname1"
And I view the work "Epic Saga"
Then I should see kudos on every chapter but the draft

Scenario: deleting pseud and user after creating kudos should orphan them

When I am logged in as "myname3"
And "myname3" creates the default pseud "foobar"
And I view the work "Awesome Story"
And I press "Kudos ♥"
Then I should see "foobar (myname3) left kudos on this work!"
When "myname3" creates the default pseud "barfoo"
And I am on myname3's pseuds page
#'
And I follow "delete_foobar"
And I view the work "Awesome Story"
Then I should see "barfoo (myname3) left kudos on this work!"
When "myname3" deletes their account
And I view the work "Awesome Story"
And "issue 2198" is fixed
# Then I should see "a guest left kudos on this work!"

Scenario: redirection when kudosing on a middle chapter, with default preferences

Given the chaptered work setup
And I am logged in as a random user
When I view the work "BigBang"
And I view the 2nd chapter
And I press "Kudos ♥"
Then I should see "Chapter 2" within ".title"
And I should not see "Chapter 1" within ".title"

Scenario: redirection when kudosing on a middle chapter, with default preferences but in temporary view full mode

Given the chaptered work setup
And I am logged in as a random user
When I view the work "BigBang" in full mode
And I press "Kudos ♥"
Then I should see "Chapter 2" within ".title"
And I should see "Chapter 3" within ".title"
Scenario: batched kudos email
When I am logged in as "myname1"
And I post the work "Another Awesome Story"
And all emails have been delivered
And the kudos queue is cleared
And I am logged in as "myname2"
And I leave kudos on "Awesome Story"
And I leave kudos on "Another Awesome Story"
And I am logged in as "someone_else"
And I leave kudos on "Awesome Story"
And I leave kudos on "Another Awesome Story"
And I am logged out
And I leave kudos on "Awesome Story"
And I leave kudos on "Another Awesome Story"
And kudos are sent
Then 1 email should be delivered to "myname1@foo.com"
And the email should contain "myname2"
And the email should contain "someone_else"
And the email should contain "guest"
And the email should contain "Awesome Story"
And the email should contain "Another Awesome Story"
Something went wrong with that request. Please try again.