From 8a5a73e49a6943100db8925a741d86f444b41403 Mon Sep 17 00:00:00 2001 From: Stefan Botzenhart Date: Wed, 4 Nov 2015 20:00:47 +0100 Subject: [PATCH 1/3] Remove duplicate key id Removes warning in log output --- app/views/time_entries/reports/show.html.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/time_entries/reports/show.html.erb b/app/views/time_entries/reports/show.html.erb index 4d4544f17d..741cfe38c2 100644 --- a/app/views/time_entries/reports/show.html.erb +++ b/app/views/time_entries/reports/show.html.erb @@ -60,10 +60,14 @@ See doc/COPYRIGHT.rdoc for more details.
<%= styled_label_tag :criterias, "#{l(:button_add)}:" %> - <%= styled_select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}), - style: 'width: 200px', - id: nil, - disabled: (@criterias.length >= 3), id: "criterias") %> + <% available_criterias = [[]] + (@available_criterias.keys - @criterias).collect{ |k| + [l_or_humanize(@available_criterias[k][:label]), k] + } + %> + <%= styled_select_tag('criterias[]', options_for_select(available_criterias), + style: 'width: 200px', + id: "criterias", + disabled: (@criterias.length >= 3)) %>
From dba38f2425594496ded77ce4795b46084f5b1052 Mon Sep 17 00:00:00 2001 From: Stefan Botzenhart Date: Wed, 4 Nov 2015 20:01:49 +0100 Subject: [PATCH 2/3] Add step to check that openproject plugin is not loaded --- features/step_definitions/general_steps.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/features/step_definitions/general_steps.rb b/features/step_definitions/general_steps.rb index df269c4c8f..87217089d3 100644 --- a/features/step_definitions/general_steps.rb +++ b/features/step_definitions/general_steps.rb @@ -101,7 +101,16 @@ end Given /^the plugin (.+) is loaded$/ do |plugin_name| plugin_name = plugin_name.gsub("\"", '') - Redmine::Plugin.all.detect { |x| x.id == plugin_name.to_sym }.present? ? nil : pending("Plugin #{plugin_name} not loaded") + Redmine::Plugin.all.detect { |x| + x.id == plugin_name.to_sym + }.present? ? nil : pending("Plugin #{plugin_name} not loaded") +end + +Given /^the plugin (.+) is not loaded$/ do |plugin_name| + plugin_name = plugin_name.gsub("\"", '') + Redmine::Plugin.all.detect { |x| + x.id == plugin_name.to_sym + }.present? ? pending("Plugin #{plugin_name} not loaded") : nil end Given /^(?:the )?[pP]roject "([^\"]*)" uses the following [mM]odules:$/ do |project, table| From 6a4f53d526e9dba158e98356409b28a76cf28087 Mon Sep 17 00:00:00 2001 From: Stefan Botzenhart Date: Wed, 4 Nov 2015 20:02:14 +0100 Subject: [PATCH 3/3] Do not run time entry cukes when cost plugin is loaded The cuke expects to find a "log time" button which is not there when the plugin is loaded. --- features/issues/time_entries.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/issues/time_entries.feature b/features/issues/time_entries.feature index b1191db9fd..c4b176a9f1 100644 --- a/features/issues/time_entries.feature +++ b/features/issues/time_entries.feature @@ -57,12 +57,14 @@ Feature: Tracking Time @javascript Scenario: Adding a time entry + Given the plugin openproject_costs is not loaded When I log 2 hours with the comment "test" Then I should see a time entry with 2 hours and comment "test" And I should see a total spent time of 6 hours @javascript @selenium Scenario: Editing a time entry + Given the plugin openproject_costs is not loaded When I update the first time entry with 4 hours and the comment "updated test" 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 @@ -72,7 +74,6 @@ Feature: Tracking Time 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