removed features as they are redmine specific

pull/6827/head
Philipp Tessenow 14 years ago
parent 107abe61b8
commit 9a7aae9834
  1. 34
      features/calculations.feature
  2. 67
      features/filter.feature
  3. 47
      features/grouping.feature
  4. 115
      features/links.feature
  5. 534
      features/permission_variations.feature
  6. 23
      features/permissions.feature
  7. 69
      features/step_definitions/custom_steps.rb

@ -1,34 +0,0 @@
Feature: Cost Reporting Calculations
Scenario: Different Rates are calculated differently
Given there is a standard cost control project named "Cost Project"
And there is 1 hourly rate with the following:
| rate | 1 |
| user | manager |
| valid from | 1 year ago |
And there is 1 hourly rate with the following:
| rate | 5 |
| user | manager |
| valid from | 2 years ago |
And there is 1 default hourly rate with the following:
| rate | 10 |
| user | manager |
| valid from | 3 years ago |
And the project "Cost Project" has 1 time entry with the following:
| hours | 10 |
| user | manager |
| spent on | 6 months ago |
And the project "Cost Project" has 1 time entry with the following:
| hours | 10 |
| user | manager |
| spent on | 18 months ago |
And the project "Cost Project" has 1 time entry with the following:
| hours | 10 |
| user | manager |
| spent on | 30 months ago |
And I am admin
And I am on the Cost Reports page for the project called "Cost Project" without filters or groups
Then I should see "10.00" # 1 EUR x 10 (hours)
And I should see "50.00" # 5 EUR x 10 (hours)
And I should see "100.00" # 10 EUR x 10 (hours)
And I should see "160.00"

@ -1,67 +0,0 @@
Feature: Filter
@javascript
Scenario: When using jump-to-project comming from the overall cost report to a projects report sets the project filter to that project
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the overall Cost Reports page
And I jump to project "First Project"
Then "First Project" should be selected for "project_id_arg_1_val"
@javascript
Scenario: When using jump-to-project comming from a projects cost report to the overall cost report page unsets the project filter
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I follow "Cost Reports"
Then "" should be selected for "project_id_arg_1_val"
@javascript
Scenario: When using jump-to-project comming from a projects cost report to another projects report sets the project filter to the second project
Given there is a standard cost control project named "First Project"
And there is a standard cost control project named "Second Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I jump to project "Second Project"
Then "Second Project" should be selected for "project_id_arg_1_val"
@javascript
Scenario: We got some awesome default settings
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
Then filter "spent_on" should be visible
And filter "user_id" should be visible
@javascript
Scenario: A click on clear removes all filters
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I click on "Clear"
Then filter "spent_on" should not be visible
And filter "user_id" should not be visible
@javascript
Scenario: A set filter is getting restored after reload
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I click on "Clear"
And I set the filter "user_id" to "2" with the operator "!"
Then filter "user_id" should be visible
When I send the query
And "2" should be selected for "user_id_arg_1_val"
And "!" should be selected for "operators_user_id"
@javascript
Scenario: Setting a Filter disables the option in the Add-Filter-Selectbox
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I click on "Clear"
Then "user_id" should be selectable from "add_filter_select"
And I set the filter "user_id" to "2" with the operator "!"
Then "user_id" should not be selectable from "add_filter_select"
When I send the query
Then "user_id" should not be selectable from "add_filter_select"

@ -1,47 +0,0 @@
Feature: Groups
@javascript
Scenario: We got some awesome default settings
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
Then I should see "Week (Spent)" within "select[@id='group_by_columns']"
And I should see "Issue" within "select[@id='group_by_rows']"
@javascript
Scenario: A click on clear removes all groups
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I click on "Clear"
Then I should not see "Week (Spent)" within "select[@id='group_by_columns']"
And I should not see "Issue" within "select[@id='group_by_rows']"
@javascript
Scenario: Groups can be added to either rows or columns
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I click on "Clear"
And I group columns by "Issue"
Then I should see "Issue" within "select[@id='group_by_columns']"
And I should not see "Issues" within "select[@id='group_by_container']"
When I group rows by "Project"
Then I should see "Project" within "select[@id='group_by_rows']"
And I should not see "Project" within "select[@id='group_by_container']"
@javascript
Scenario: Groups get restored after sending a query
Given there is a standard cost control project named "First Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I click on "Clear"
And I group columns by "Issue"
And I group columns by "Project"
And I group rows by "User"
And I group rows by "Cost type"
And I send the query
Then I should see "Project" within "select[@id='group_by_columns']"
And I should see "Issue" within "select[@id='group_by_columns']"
And I should see "User" within "select[@id='group_by_rows']"
And I should see "User" within "select[@id='group_by_rows']"

@ -1,115 +0,0 @@
Feature: Cost Reporting Linkage
@javascript
Scenario: Coming to the cost report for the first time, I should see no entries that are not my own
Given there is a standard cost control project named "Some Project"
And there is 1 cost type with the following:
| name | Translation |
And the user "manager" has 1 cost entry
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "Some Project"
Then I should see "Cost Entry Attributes"
And I should see "User"
And I should see "<< me >>"
And I should see "No data to display"
And I should not see "0.00"
Scenario: Coming to the cost report for the first time, I should see my entries
Given there is a standard cost control project named "Standard Project"
And the user "manager" has:
| hourly rate | 10 |
| default rate | 10 |
And the user "manager" has 1 issue with:
| subject | manager issue |
And the issue "manager issue" has 1 time entry with the following:
| user | manager |
| hours | 10 |
And there is 1 cost type with the following:
| name | word |
| cost rate | 1.01 |
And the issue "manager issue" has 1 cost entry with the following:
| units | 7 |
| user | manager |
| cost type | word |
And I am logged in as "manager"
And I am on the Cost Reports page for the project called "Standard Project"
Then I should see "107.07" # 100 EUR (labour cost) + 7.07 EUR (words)
And I should not see "No data to display"
Scenario: Going from an Issue to the cost report should set the filter on this issue
Given there is a standard cost control project named "Standard Project"
And the role "Manager" may have the following rights:
| view_own_hourly_rate |
| view_issues |
| view_own_time_entries |
| view_own_cost_entries |
| view_cost_rates |
And the user "manager" has:
| default rate | 10 |
And the user "manager" has 1 issue with:
| subject | manager issue |
And the user "manager" has 1 issue with:
| subject | another issue |
And the issue "manager issue" has 1 time entry with the following:
| user | manager |
| hours | 10 |
And the issue "another issue" has 1 time entry with the following:
| user | manager |
| hours | 5 |
And I am logged in as "manager"
And I am on the page for the issue "manager issue"
Then I should see "10.00 hours"
And I follow "10.00 hours"
Then I should see "100.00" # 10 EUR x 10 (hours)
And I should not see "50.00" # 10 EUR x 5 (hours)
And I should not see "150.00"
Scenario: Going from an Issue to the cost report should set the filter on this issue
Given there is a standard cost control project named "Standard Project"
And there is 1 cost type with the following:
| name | word |
| cost rate | 10 |
And the user "manager" has 1 issue with:
| subject | manager issue |
And the user "manager" has 1 issue with:
| subject | another issue |
And the issue "manager issue" has 1 cost entry with the following:
| user | manager |
| units | 10 |
And the issue "another issue" has 1 cost entry with the following:
| user | manager |
| units | 5 |
And I am logged in as "manager"
And I am on the page for the issue "manager issue"
Then I should see "10.0 words"
And I follow "10.0 words"
Then I should see "100.00" # 10 EUR x 10 (words)
And I should not see "50.00" # 10 EUR x 5 (words)
And I should not see "150.00"
@javascript
Scenario: Reporting on the project page should be accessible from the spent time
Given there is a standard cost control project named "Standard Project"
And the project "Standard Project" has 1 issue with the following:
| subject | test_issue |
And the issue "test_issue" has 1 time entry with the following:
| hours | 1.00 |
| user | manager |
And I am logged in as "manager"
When I am on the page for the project "Standard Project"
Then I should see "Spent time" within "#sidebar"
And I should see "1.00 hour" within "#sidebar"
And I should not see "Details" within "#sidebar"
And I should not see "Report" within "#sidebar"
When I follow "1.00 hour"
Then I should be on the Cost Reports page for the project called "Standard Project"
@javascript
Scenario: Jump to project from the cost report jumps to the cost report of the selected project
Given there is a standard cost control project named "First Project"
And there is a standard cost control project named "Second Project"
And I am logged in as "controller"
And I am on the Cost Reports page for the project called "First Project"
And I jump to project "Second Project"
Then I should see "Second Project" within "#header h1"
And I should not see "First Project" within "#header h1"

@ -1,534 +0,0 @@
Feature: Permissions
######################
# Dimensions to test:
#
# see_cost_entries: none, own, all
# see_time_entries: none, own, all
# see_rates: none, own, all
Scenario: Anonymous can not access the project specific cost reports page
Given there is a standard permission test project named "Permission_Test"
And I am not logged in
And I am on the Cost Reports page for the project called "Permission_Test" without filters or groups
Then I should see "Login:"
And I should see "Password:"
Scenario: Anonymous can not access the overall cost reports page as there are no other public projects
Given there is a standard permission test project named "Permission_Test"
And I am not logged in
And I am on the overall Cost Reports page without filters or groups
Then I should see "Login:"
And I should see "Password:"
Scenario: Admin sees everything
Given there is a standard permission test project named "Permission_Test"
And I am admin
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who has all rights sees everything
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_hourly_rates |
| view_cost_rates |
| view_own_time_entries |
| view_own_cost_entries |
| view_cost_entries |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who has no rights, sees nothing
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| none |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "403" # permission denied
Scenario: User who may only see own cost entries, only sees his own cost entries without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should not see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may only see cost entries, sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should not see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may only see his own time entries, only sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should not see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may only see time entries, only sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should not see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may only see own time and cost entries, only sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_time_entries |
| view_own_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may only see own time entries, but all cost entries, sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_time_entries |
| view_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may only see own cost entries, but all time entries, sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_cost_entries |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who my see all time and cost entries, sees them without costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_cost_entries |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may see own costs, but no entries sees nothing
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "403" # access denied
Scenario: User who may see own costs and own cost entries, sees them with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_own_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should not see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see own costs and all cost entries, sees all cost entries, but own costs only
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should not see "11.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should see "-" within ".result"
# TimeEntries
And I should not see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may see own costs and own time entries, sees his entries with own costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_own_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should not see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: A user who may see own costs, own time entries and own cost entries, sees then with costs (as they are his costs)
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_own_time_entries |
| view_own_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see own costs, own time entries and all cost entries, only sees those entries and only own entries with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_own_time_entries |
| view_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may see own costs and time entries, only sees own time entries with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should not see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who can see own costs, all time entries and only his own cost entries, see only the requested entries where costs are only visible on own entries
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_own_cost_entries |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see own costs and all entries, only sees his own entries attached with costs
# ATTENTION: there is no right to see own CostEntry costs - so no costs for cost entries are visible after all
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_cost_entries |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who can see all costs but no entries sees nothing after all
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "403" #access denied
Scenario: User wh can see all costs and his own cost entries, only sees own cost entries with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_own_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "1.00 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should not see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see all costs and all cost entries, sees all cost entries with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "11.00 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should not see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may see all costs and own time entries, sees them with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_own_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should not see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see all costs, own time- and cost- entries, sees his own entires with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_own_time_entries |
| view_own_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "1.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see all costs, own time entries and all cost entries, only sees them with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_own_time_entries |
| view_cost_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "11.01 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should not see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should see "1.0 ten" # other
Scenario: User who may see all costs and all time entries, sees them with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "0.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should not see "1.0 one" # own
And I should not see "1.0 ten" # other
Scenario: User who may see all costs, all time entries and his own cost entries, sees them with costs
Given there is a standard permission test project named "Permission_Test"
And the role "Testuser" may have the following rights:
| view_hourly_rates |
| view_cost_rates |
| view_own_cost_entries |
| view_time_entries |
And I am logged in as "testuser"
And I am on the overall Cost Reports page without filters or groups
Then I should see "Cost Report" within "#content"
And I should not see "No data to display"
# Costs
And I should see "1.11 EUR" within ".result" # costs (0.01 [own, time] + 0.10 [other, time] + 1.00 [own, cost] + 11.00 [other, cost])
And I should not see "-" within ".result"
# TimeEntries
And I should see "1.00 hour" # own
And I should see "2.00 hour" # other
# CostEntries
And I should see "1.0 one" # own
And I should not see "1.0 ten" # other

@ -1,23 +0,0 @@
Feature: Permissions
#XXX: Test permissions on table and simple table (currently testet in _cost_entry_table partial only)
#XXX: Test access permissions for /cost_reports AND /project/../cost_reports - sometimes there is access denied where is should not and vice versa
@changes_environment
Scenario: Enabling the debug-flag doesn't work in production mode
When we can finally switch the ruby environment within our cukes
Given there is a standard permission test project named "Permission_Test"
And I am in "production" mode
And I am admin
And I am on the overall Cost Reports page with standard groups in debug mode
And I start debugging
Then I should not see "[ RESULT ]"
And I should not see "[ Query ]"
@changes_environment
Scenario: Enabling the debug-flag works in development mode
Given there is a standard permission test project named "Permission_Test"
And I am in "development" mode
And I am admin
And I am on the overall Cost Reports page with standard groups in debug mode
Then I should see "[ RESULT ]"
And I should see "[ Query ]"

@ -1,69 +0,0 @@
Given /^there is a standard permission test project named "([^\"]*)"$/ do |name|
steps %Q{
Given there is 1 project with the following:
| Name | #{name} |
And the project "#{name}" has 1 issue with:
| subject | #{name}issue |
And there is a role "Testuser"
And the role "Testuser" may have the following rights:
| view_own_hourly_rate |
| view_hourly_rates |
| view_cost_rates |
| view_own_time_entries |
| view_own_cost_entries |
| view_cost_entries |
| view_time_entries |
And there is 1 User with:
| Login | testuser |
| Firstname | Test |
| Lastname | User |
| default rate | 0.01 |
And the user "testuser" is a "Testuser" in the project "#{name}"
And there is 1 User with:
| Login | otheruser |
| Firstname | Other |
| Lastname | User |
| default rate | 0.05 |
And the user "otheruser" is a "Testuser" in the project "#{name}"
And there is 1 cost type with the following:
| name | one |
| cost rate | 1.00 |
And there is 1 cost type with the following:
| name | ten |
| cost rate | 10.00 |
And the issue "#{name}issue" has 1 time entry with the following:
| hours | 1 |
| user | testuser |
And the issue "#{name}issue" has 1 time entry with the following:
| hours | 2 |
| user | otheruser |
And the issue "#{name}issue" has 1 cost entry with the following:
| units | 1 |
| user | testuser |
| cost type | one |
And the issue "#{name}issue" has 1 cost entry with the following:
| units | 1 |
| user | otheruser |
| cost type | ten |
}
end
Given /^I set the filter "([^"]*)" to "([^"]*)" with the operator "([^"]*)"$/ do |filter, value, operator|
locate :xpath, "//body"
page.evaluate_script("restore_filter(\"#{filter}\", \"#{operator}\", \"#{value}\")")
end
When /^I send the query$/ do
find(:xpath, '//p[@class="buttons"]/a[@class="button apply"]').click
end
Then /^filter "([^"]*)" should (not )?be visible$/ do |filter, negative|
bool = negative ? false : true
page.evaluate_script("$('tr_#{filter}').visible()") =~ /^#{bool}$/
end
Given /^I group (rows|columns) by "([^"]*)"/ do |target, group|
destination = target == "rows" ? "moveLeft" : "moveUp"
When %{I select "#{group}" from "group_by_container"}
find(:xpath, "//input[@class='buttons group_by move #{destination}']").click
end
Loading…
Cancel
Save