diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/support/helpers/javascript_fixtures_helpers.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/support/helpers/javascript_fixtures_helpers.rb')
-rw-r--r-- | spec/support/helpers/javascript_fixtures_helpers.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/support/helpers/javascript_fixtures_helpers.rb b/spec/support/helpers/javascript_fixtures_helpers.rb index 4c90b907d2d..5174c145a93 100644 --- a/spec/support/helpers/javascript_fixtures_helpers.rb +++ b/spec/support/helpers/javascript_fixtures_helpers.rb @@ -42,9 +42,12 @@ module JavaScriptFixturesHelpers # Public: Reads a GraphQL query from the filesystem as a string # - # query_path - file path to the GraphQL query, relative to `app/assets/javascripts` - def get_graphql_query_as_string(query_path) - path = Rails.root / 'app/assets/javascripts' / query_path + # query_path - file path to the GraphQL query, relative to `app/assets/javascripts`. + # ee - boolean, when true `query_path` will be looked up in `/ee`. + def get_graphql_query_as_string(query_path, ee: false) + base = (ee ? 'ee/' : '') + 'app/assets/javascripts' + + path = Rails.root / base / query_path queries = Gitlab::Graphql::Queries.find(path) if queries.length == 1 queries.first.text(mode: Gitlab.ee? ? :ee : :ce ) |