diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/graphql/mutations/issues/set_due_date_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/graphql/mutations/issues/set_due_date_spec.rb')
-rw-r--r-- | spec/graphql/mutations/issues/set_due_date_spec.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/spec/graphql/mutations/issues/set_due_date_spec.rb b/spec/graphql/mutations/issues/set_due_date_spec.rb index 9f8d0d6c405..263122e5d5f 100644 --- a/spec/graphql/mutations/issues/set_due_date_spec.rb +++ b/spec/graphql/mutations/issues/set_due_date_spec.rb @@ -3,8 +3,9 @@ require 'spec_helper' RSpec.describe Mutations::Issues::SetDueDate do - let(:issue) { create(:issue) } - let(:user) { create(:user) } + let(:issue) { create(:issue, due_date: '2021-05-01') } + + let_it_be(:user) { create(:user) } subject(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) } @@ -23,17 +24,25 @@ RSpec.describe Mutations::Issues::SetDueDate do issue.project.add_developer(user) end - it 'returns the issue with updated due date' do + it 'returns the issue with updated due date', :aggregate_failures do expect(mutated_issue).to eq(issue) expect(mutated_issue.due_date).to eq(Date.today + 2.days) expect(subject[:errors]).to be_empty end + context 'when due date is nil' do + let(:due_date) { nil } + + it 'updates due date to be nil' do + expect(mutated_issue.due_date).to be nil + end + end + context 'when passing incorrect due date value' do let(:due_date) { 'test' } - it 'does not update due date' do - expect(mutated_issue.due_date).to eq(issue.due_date) + it 'updates due date to be nil' do + expect(mutated_issue.due_date).to be nil end end end |