pull/1443/head
Hagen Schink 11 years ago
parent 797cbeeeaa
commit 8c8d9b7e57
  1. 3
      app/views/time_entries/reports/show.html.erb
  2. 18
      features/issues/time_entries.feature
  3. 16
      features/step_definitions/time_entry_steps.rb
  4. 4
      features/support/paths.rb

@ -47,7 +47,8 @@ See doc/COPYRIGHT.rdoc for more details.
<%= render :partial => 'timelog/date_range' %>
<%= render 'timelog/time_entry_tabs' %>
<p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
<p class="timelog-report-selection">
<label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
[l(:label_month), 'month'],
[l(:label_week), 'week'],
[l(:label_day_plural).titleize, 'day']], @columns),

@ -65,3 +65,21 @@ Feature: Tracking Time
Then I should see a time entry with 4 hours and comment "updated test"
And I should see a total spent time of 4 hours
@javascript
Scenario: Selecting time period
When I go to the time entry page of issue "issue1"
And I select "yesterday" from "period"
Then I should not see a total spent time of 0 hours
When I click "Apply"
Then I should see a total spent time of 0 hours
@javascript
Scenario: Selecting month for spent time report
When I go to the time entry report page of issue "issue1"
And I select "Year" from "Details"
And I select "Project" from "Add"
Then I should not see a total spent time of 4 hours
When I click "Apply" within ".timelog-report-selection"
Then I should see a total spent time of 4 hours

@ -49,9 +49,19 @@ Then(/^I should see a time entry with (\d+) hours and comment "(.*)"$/) do |hour
expect(page).to have_content(comment)
end
Then(/^I should see a total spent time of (\d+) hours$/) do |hours|
within('div.total-hours') do
expect(find("span.hours-int")).to have_content hours
Then(/^I should (not )?see a total spent time of (\d+) hours$/) do |negative, hours|
available = find('div.total-hours') rescue false
if available || !negative
within('div.total-hours') do
element = find("span.hours-int")
if negative
expect(element).not_to have_content hours
else
expect(element).to have_content hours
end
end
end
end

@ -352,6 +352,10 @@ module NavigationHelpers
issue_id = WorkPackage.find_by_subject($1).id
"/work_packages/#{issue_id}/time_entries"
when /^the time entry report page of issue "(.+)"$/
issue_id = WorkPackage.find_by_subject($1).id
"/work_packages/#{issue_id}/time_entries/report"
when /^the move new page of the work package "(.+)"$/
work_package_id = WorkPackage.find_by_subject($1).id
"/work_packages/#{work_package_id}/move/new?copy="

Loading…
Cancel
Save