summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-04-01 10:55:33 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2019-04-01 10:55:33 +0200
commite756dca0c5f32c2507fc2ef23c89c6e36e0e1b4c (patch)
tree0b4bfa3a4aea7f575c031303ec8985fecfa7ed28
parent093629fedc43e8b481c6626765e3fcf0603add17 (diff)
downloadgitlab-ce-e756dca0c5f32c2507fc2ef23c89c6e36e0e1b4c.tar.gz
Extra permissions in Project & Issue GraphQL
Allow extra permissions for the `Types::ProjectType` and `Types:IssueType` GraphQL types. As we'll be adding more permissions in CE. Now this spec only validates if all the expected permissions are present, but it will not fail if there are more.
-rw-r--r--spec/graphql/types/permission_types/issue_spec.rb4
-rw-r--r--spec/graphql/types/permission_types/project_spec.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/spec/graphql/types/permission_types/issue_spec.rb b/spec/graphql/types/permission_types/issue_spec.rb
index c3f84629aa2..f0fbeda202f 100644
--- a/spec/graphql/types/permission_types/issue_spec.rb
+++ b/spec/graphql/types/permission_types/issue_spec.rb
@@ -7,6 +7,8 @@ describe Types::PermissionTypes::Issue do
:create_note, :reopen_issue
]
- expect(described_class).to have_graphql_fields(expected_permissions)
+ expected_permissions.each do |permission|
+ expect(described_class).to have_graphql_field(permission)
+ end
end
end
diff --git a/spec/graphql/types/permission_types/project_spec.rb b/spec/graphql/types/permission_types/project_spec.rb
index 4288412eda3..4974995b587 100644
--- a/spec/graphql/types/permission_types/project_spec.rb
+++ b/spec/graphql/types/permission_types/project_spec.rb
@@ -13,6 +13,8 @@ describe Types::PermissionTypes::Project do
:update_wiki, :destroy_wiki, :create_pages, :destroy_pages, :read_pages_content
]
- expect(described_class).to have_graphql_fields(expected_permissions)
+ expected_permissions.each do |permission|
+ expect(described_class).to have_graphql_field(permission)
+ end
end
end