forked from harley/newstc
-
Notifications
You must be signed in to change notification settings - Fork 3
/
dept_payforms_configs.feature
98 lines (88 loc) · 3.43 KB
/
dept_payforms_configs.feature
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
@configs
@cw
Feature: Payform settings
In order to manage payform settings
As an admin
I want to be able to configure payform settings
Background:
Given I am "Albus Dumbledore"
And the user "Albus Dumbledore" has permission "Hogwarts dept admin"
And I am on the department settings page
Scenario: Payform settings: Min Length for Item description
When I fill in "department_config_description_min" with "12"
And I press "Submit"
And I follow "Logout"
Given I am "Harry Potter"
And "Harry Potter" has a current payform
And I have no payform_items
When I go to the homepage
And I follow "Payforms"
And I follow "New Payform Item"
And I select "03" from "time_input_start_4i"
And I select "00" from "time_input_start_5i"
And I select "PM" from "time_input_start_7i"
And I select "05" from "time_input_end_4i"
And I select "00" from "time_input_end_5i"
And I select "PM" from "time_input_end_7i"
And I select "Study" from "payform_item_category_id"
And I fill in "Description" with "description"
And I press "Create"
Then I should see "Description is too short"
And I should have 0 payform_items
When I fill in "Description" with "a longer description"
And I press "Create"
Then I should see "Successfully created payform item."
And I should have 1 payform_item
Scenario: Payform settings: Min Length for edit and deletion of reason
Given "Harry Potter" has a current payform
And "Harry Potter" has the following current payform item
| category | hours | description |
| Quidditch | 2 | played a game |
When I fill in "department_config[reason_min]" with "7"
And I press "Submit"
And I follow "Logout"
Given I am "Harry Potter"
And I am on the payforms page
And I follow "edit"
And I fill in "Hours" with "3"
And I fill in "Reason" with "edited"
And I press "Submit"
Then I should see "Reason seems too short"
And I should have 1 payform_item
Given I fill in "Reason" with "a longer reason"
And I press "Submit"
Then I should see "Payform item edited"
And I should have 2 payform_items
When I follow "✖"
And I fill in "Reason" with "delete"
And I press "Delete"
Then I should see "Reason seems too short"
And I should have 1 payform_item
And payform item 1 should have attribute "active" "true"
When I fill in "Reason" with "a longer reason"
And I press "Delete"
Then I should see "Payform item destroyed"
And I should have 1 payform_item
And payform item 1 should have attribute "active" "false"
Scenario: Payform settings: Disabled Categories vs Miscellaneous
Given "Harry Potter" has a current payform
And "Harry Potter" has the following current payform item
| category | hours | description |
| Quidditch | 2 | played a game |
When I check "department_config_show_disabled_cats"
And I press "Submit"
And I disable the "Work" category
And I follow "Logout"
Given I am "Harry Potter"
And I am on the payforms page
Then I should see "Quidditch"
When I follow "Logout"
Given I am "Albus Dumbledore"
And I am on the department settings page
When I uncheck "department_config_show_disabled_cats"
And I press "Submit"
And I follow "Logout"
Given I am "Harry Potter"
And I am on the payforms page
Then I should not see "Quidditch"
And I should see "Miscellaneous"