summaryrefslogtreecommitdiff
path: root/spec/graphql/mutations/todos/restore_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/graphql/mutations/todos/restore_spec.rb')
-rw-r--r--spec/graphql/mutations/todos/restore_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/graphql/mutations/todos/restore_spec.rb b/spec/graphql/mutations/todos/restore_spec.rb
index 22fb1bba7a8..954bb3db668 100644
--- a/spec/graphql/mutations/todos/restore_spec.rb
+++ b/spec/graphql/mutations/todos/restore_spec.rb
@@ -5,17 +5,23 @@ require 'spec_helper'
RSpec.describe Mutations::Todos::Restore do
include GraphqlHelpers
+ let_it_be(:project) { create(:project) }
+ let_it_be(:issue) { create(:issue, project: project) }
let_it_be(:current_user) { create(:user) }
let_it_be(:author) { create(:user) }
let_it_be(:other_user) { create(:user) }
- let_it_be(:todo1) { create(:todo, user: current_user, author: author, state: :done) }
- let_it_be(:todo2) { create(:todo, user: current_user, author: author, state: :pending) }
+ let_it_be(:todo1) { create(:todo, user: current_user, author: author, state: :done, target: issue) }
+ let_it_be(:todo2) { create(:todo, user: current_user, author: author, state: :pending, target: issue) }
let_it_be(:other_user_todo) { create(:todo, user: other_user, author: author, state: :done) }
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
+ before_all do
+ project.add_developer(current_user)
+ end
+
specify { expect(described_class).to require_graphql_authorizations(:update_todo) }
describe '#resolve' do