@@ -555,7 +555,13 function beforeShowDatePicker(input, inst) { | |||||
555 | break; |
|
555 | break; | |
556 | case "issue_due_date" : |
|
556 | case "issue_due_date" : | |
557 | if ($("#issue_start_date").size() > 0) { |
|
557 | if ($("#issue_start_date").size() > 0) { | |
558 |
|
|
558 | var start_date = $("#issue_start_date").val(); | |
|
559 | if (start_date != "") { | |||
|
560 | start_date = new Date(Date.parse(start_date)); | |||
|
561 | if (start_date > new Date()) { | |||
|
562 | default_date = $("#issue_start_date").val(); | |||
|
563 | } | |||
|
564 | } | |||
559 | } |
|
565 | } | |
560 | break; |
|
566 | break; | |
561 | } |
|
567 | } |
@@ -60,6 +60,11 module Redmine | |||||
60 | assert_equal '/my/page', current_path |
|
60 | assert_equal '/my/page', current_path | |
61 | end |
|
61 | end | |
62 |
|
62 | |||
|
63 | setup do | |||
|
64 | # Set the page width higher than 900 to get the full layout with sidebar | |||
|
65 | page.driver.browser.manage.window.resize_to(1024, 900) | |||
|
66 | end | |||
|
67 | ||||
63 | teardown do |
|
68 | teardown do | |
64 | Capybara.reset_sessions! # Forget the (simulated) browser state |
|
69 | Capybara.reset_sessions! # Forget the (simulated) browser state | |
65 | Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver |
|
70 | Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver |
@@ -21,7 +21,7 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base | |||||
21 | fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles, |
|
21 | fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles, | |
22 | :trackers, :projects_trackers, :enabled_modules, :issue_statuses, :issues, |
|
22 | :trackers, :projects_trackers, :enabled_modules, :issue_statuses, :issues, | |
23 | :enumerations, :custom_fields, :custom_values, :custom_fields_trackers, |
|
23 | :enumerations, :custom_fields, :custom_values, :custom_fields_trackers, | |
24 | :watchers |
|
24 | :watchers, :journals, :journal_details | |
25 |
|
25 | |||
26 | def test_create_issue |
|
26 | def test_create_issue | |
27 | log_user('jsmith', 'jsmith') |
|
27 | log_user('jsmith', 'jsmith') | |
@@ -150,15 +150,30 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base | |||||
150 | end |
|
150 | end | |
151 | end |
|
151 | end | |
152 |
|
152 | |||
153 | def test_create_issue_start_due_date_default |
|
153 | def test_default_due_date_proposed_in_date_picker | |
154 | log_user('jsmith', 'jsmith') |
|
154 | log_user('jsmith', 'jsmith') | |
155 | visit '/projects/ecookbook/issues/new' |
|
155 | visit '/projects/ecookbook/issues/new' | |
|
156 | ||||
|
157 | # Future start date: due date should default to start date | |||
|
158 | fill_in 'Start date', :with => '2027-04-01' | |||
|
159 | fill_in 'Due date', :with => '' | |||
|
160 | page.first('p#due_date_area img').click | |||
|
161 | page.first("td.ui-datepicker-days-cell-over a").click | |||
|
162 | assert_equal '2027-04-01', page.find('input#issue_due_date').value | |||
|
163 | ||||
|
164 | # Passed start date: due date should default to today | |||
156 | fill_in 'Start date', :with => '2012-04-01' |
|
165 | fill_in 'Start date', :with => '2012-04-01' | |
157 | fill_in 'Due date', :with => '' |
|
166 | fill_in 'Due date', :with => '' | |
158 | page.first('p#due_date_area img').click |
|
167 | page.first('p#due_date_area img').click | |
159 | page.first("td.ui-datepicker-days-cell-over a").click |
|
168 | page.first("td.ui-datepicker-days-cell-over a").click | |
160 |
assert_equal |
|
169 | assert_equal Date.today.to_s, page.find('input#issue_due_date').value | |
|
170 | end | |||
|
171 | ||||
|
172 | def test_default_start_date_proposed_in_date_picker | |||
|
173 | log_user('jsmith', 'jsmith') | |||
|
174 | visit '/projects/ecookbook/issues/new' | |||
161 |
|
175 | |||
|
176 | # Passed due date: start date should default to due date | |||
162 | fill_in 'Start date', :with => '' |
|
177 | fill_in 'Start date', :with => '' | |
163 | fill_in 'Due date', :with => '2012-04-01' |
|
178 | fill_in 'Due date', :with => '2012-04-01' | |
164 | page.first('p#start_date_area img').click |
|
179 | page.first('p#start_date_area img').click |
General Comments 0
You need to be logged in to leave comments.
Login now