diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-05-21 03:34:43 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-05-21 03:34:43 +0000 |
commit | 73403c4ca77c62388858775b2e73e9d4341fe472 (patch) | |
tree | f8158beb1d1e9338eec628fbf1e9e60dc4718368 /spec | |
parent | 98b1daf32df2bc811328da18e20719a12c471f1f (diff) | |
parent | f307ff34134caa376b50e00f8e285c355b4af701 (diff) | |
download | gitlab-ce-73403c4ca77c62388858775b2e73e9d4341fe472.tar.gz |
Merge branch 'issuable-new-due-date' into 'master'
Issuable form due date
For some reason, this was never in the original merge request for due date?
![Screen_Shot_2016-04-22_at_21.49.44](/uploads/7d4e2b07f75a33009e3170fdb076a4bd/Screen_Shot_2016-04-22_at_21.49.44.png)
Closes #15516
See merge request !3895
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issues_spec.rb | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index d5755c293c5..dd114db7e88 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -64,6 +64,64 @@ describe 'Issues', feature: true do end end + describe 'due date', js: true do + context 'on new form' do + before do + visit new_namespace_project_issue_path(project.namespace, project) + end + + it 'should save with due date' do + date = Date.today.at_beginning_of_month + + fill_in 'issue_title', with: 'bug 345' + fill_in 'issue_description', with: 'bug description' + + page.within '.datepicker' do + click_link date.day + end + + expect(find('#issuable-due-date', visible: false).value).to eq date.to_s + + click_button 'Submit issue' + + page.within '.issuable-sidebar' do + expect(page).to have_content date.to_s(:medium) + end + end + end + + context 'on edit form' do + let(:issue) { create(:issue, author: @user,project: project, due_date: Date.today.at_beginning_of_month.to_s) } + + before do + visit edit_namespace_project_issue_path(project.namespace, project, issue) + end + + it 'should save with due date' do + date = Date.today.at_beginning_of_month + + expect(find('#issuable-due-date', visible: false).value).to eq date.to_s + + date = date.tomorrow + + fill_in 'issue_title', with: 'bug 345' + fill_in 'issue_description', with: 'bug description' + + page.within '.datepicker' do + click_link date.day + end + + expect(find('#issuable-due-date', visible: false).value).to eq date.to_s + + click_button 'Save changes' + + page.within '.issuable-sidebar' do + expect(page).to have_content date.to_s(:medium) + end + end + end + end + describe 'Issue info' do it 'excludes award_emoji from comment count' do issue = create(:issue, author: @user, assignee: @user, project: project, title: 'foobar') @@ -331,7 +389,7 @@ describe 'Issues', feature: true do page.within '.assignee' do click_link 'Edit' end - + page.within '.dropdown-menu-user' do click_link @user.name end |