@@ -561,7 +561,13 function beforeShowDatePicker(input, inst) { | |||
|
561 | 561 | break; |
|
562 | 562 | case "issue_due_date" : |
|
563 | 563 | if ($("#issue_start_date").size() > 0) { |
|
564 |
|
|
|
564 | var start_date = $("#issue_start_date").val(); | |
|
565 | if (start_date != "") { | |
|
566 | start_date = new Date(Date.parse(start_date)); | |
|
567 | if (start_date > new Date()) { | |
|
568 | default_date = $("#issue_start_date").val(); | |
|
569 | } | |
|
570 | } | |
|
565 | 571 | } |
|
566 | 572 | break; |
|
567 | 573 | } |
@@ -150,15 +150,30 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base | |||
|
150 | 150 | end |
|
151 | 151 | end |
|
152 | 152 | |
|
153 | def test_create_issue_start_due_date_default | |
|
153 | def test_default_due_date_proposed_in_date_picker | |
|
154 | 154 | log_user('jsmith', 'jsmith') |
|
155 | 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 | 165 | fill_in 'Start date', :with => '2012-04-01' |
|
157 | 166 | fill_in 'Due date', :with => '' |
|
158 | 167 | page.first('p#due_date_area img').click |
|
159 | 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 | 177 | fill_in 'Start date', :with => '' |
|
163 | 178 | fill_in 'Due date', :with => '2012-04-01' |
|
164 | 179 | page.first('p#start_date_area img').click |
General Comments 0
You need to be logged in to leave comments.
Login now