forked from sigmike/peer4commit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtip_modifier_interface.feature
More file actions
124 lines (107 loc) · 4.72 KB
/
tip_modifier_interface.feature
File metadata and controls
124 lines (107 loc) · 4.72 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
Feature: A project collaborator can change the tips of commits
Background:
Given a project "a"
And the project collaborators are:
| seldon |
| daneel |
And our fee is "0"
And a deposit of "500"
And the last known commit is "AAA"
And a new commit "BBB" with parent "AAA"
And a new commit "CCC" with parent "BBB"
And the author of commit "BBB" is "yugo"
And the message of commit "BBB" is "Tiny change"
And the author of commit "CCC" is "gaal"
Scenario: Without anything modified
When the new commits are read
Then there should be a tip of "5" for commit "BBB"
And there should be a tip of "4.95" for commit "CCC"
And there should be 2 email sent
Scenario: A collaborator wants to alter the tips
Given I'm logged in as "seldon"
And I go to the project page
And I click on "Change project settings"
And I check "Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent"
And I click on "Save the project settings"
Then I should see "The project settings have been updated"
When the new commits are read
Then the tip amount for commit "BBB" should be undecided
And the tip amount for commit "CCC" should be undecided
And there should be 0 email sent
When I go to the project page
And I click on "Decide tip amounts"
Then I should see "BBB"
And I should see "Tiny change"
And I should see "CCC"
And I should not see "AAA"
When I choose the amount "Tiny: 0.1%" on commit "BBB"
And I click on "Send the selected tip amounts"
Then there should be a tip of "0.5" for commit "BBB"
And the tip amount for commit "CCC" should be undecided
And there should be 1 email sent
When the email counters are reset
And I choose the amount "Free: 0%" on commit "CCC"
And I click on "Send the selected tip amounts"
Then there should be a tip of "0.5" for commit "BBB"
And there should be a tip of "0" for commit "CCC"
And there should be 0 email sent
Scenario: A non collaborator does not see the settings button
Given I'm logged in as "yugo"
And I go to the project page
Then I should not see "Change project settings"
Scenario: A non collaborator does not see the decide tip amounts button
Given the project has undedided tips
And I'm logged in as "yugo"
And I go to the project page
Then I should not see "Decide tip amounts"
Scenario: A non collaborator goes to the edit page of a project
Given I'm logged in as "yugo"
When I go to the edit page of the project
Then I should see an access denied
Scenario: A non collaborator sends a forged update on a project
Given I'm logged in as "yugo"
When I send a forged request to enable tip holding on the project
Then I should see an access denied
And the project should not hold tips
Scenario: A collaborator sends a forged update on a project
Given I'm logged in as "daneel"
When I send a forged request to enable tip holding on the project
Then the project should hold tips
Scenario Outline: A user sends a forged request to set a tip amount
Given the project has 1 undecided tip
And I'm logged in as "<user>"
And I go to the project page
And I send a forged request to set the amount of the first undecided tip of the project
Then the project should have <remaining undecided tips> undecided tips
Examples:
| user | remaining undecided tips |
| seldon | 0 |
| yugo | 1 |
Scenario: A collaborator sends large amounts in tips
Given 20 new commits
And a new commit "last"
And the project holds tips
When the new commits are read
And I'm logged in as "seldon"
And I go to the project page
And I click on "Decide tip amounts"
And I choose the amount "Huge: 5%" on all commits
And I click on "Send the selected tip amounts"
Then there should be a tip of "25" for commit "BBB"
And there should be a tip of "8.088338" for commit "last"
Scenario Outline: A collaborator changes the amount of a tip on another project
Given the project holds tips
And the new commits are read
And a project "fake"
And the project collaborators are:
| bad guy |
And a new commit "fake commit"
And the project holds tips
When the new commits are read
And I'm logged in as "<user>"
And I send a forged request to change the percentage of commit "BBB" on project "a" to "5"
Then <consequences>
Examples:
| user | consequences |
| seldon | there should be a tip of "25" for commit "BBB" |
| bad guy | the tip amount for commit "BBB" should be undecided |