Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/graphql/mutations/work_items/update_spec.rb')
-rw-r--r--spec/graphql/mutations/work_items/update_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/graphql/mutations/work_items/update_spec.rb b/spec/graphql/mutations/work_items/update_spec.rb
new file mode 100644
index 00000000000..3acb06346a4
--- /dev/null
+++ b/spec/graphql/mutations/work_items/update_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Mutations::WorkItems::Update, feature_category: :portfolio_management do
+ let_it_be(:project) { create(:project) }
+ let_it_be(:developer) { create(:user).tap { |user| project.add_developer(user) } }
+ let_it_be(:current_work_item) { create(:work_item, :task, project: project) }
+ let_it_be(:parent_work_item) { create(:work_item, project: project) }
+
+ subject(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
+
+ describe '#ready?' do
+ let(:current_user) { developer }
+ let(:current_gid) { current_work_item.to_gid.to_s }
+ let(:parent_gid) { parent_work_item.to_gid.to_s }
+ let(:valid_arguments) { { id: current_gid, parent_id: parent_gid } }
+
+ it { is_expected.to be_ready(**valid_arguments) }
+ end
+end