diff options
author | charlie ablett <cablett@gitlab.com> | 2019-05-24 01:43:47 +0300 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-05-31 10:57:02 +0300 |
commit | 699532232ca27e6079c553261e0ab1d17317472a (patch) | |
tree | 47c7e56de28ba1857add8ea13627de07936e117e /spec/lib/gitlab/graphql_logger_spec.rb | |
parent | 5f0c230a18b677bd4ec6a4a54085775b0c69a498 (diff) |
Apply reviewer feedback
- Comply doc with guidelines
- Improve tests for readability and completeness
- Separate out phases visually with newlines
- Add `format_message` test
- test readability
- code and test structure/styling
- static query analyzers
- call `as_json` on `provided_variables`
- add exception handling
Diffstat (limited to 'spec/lib/gitlab/graphql_logger_spec.rb')
-rw-r--r-- | spec/lib/gitlab/graphql_logger_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/lib/gitlab/graphql_logger_spec.rb b/spec/lib/gitlab/graphql_logger_spec.rb index c8d4dac2153..4977f98b83e 100644 --- a/spec/lib/gitlab/graphql_logger_spec.rb +++ b/spec/lib/gitlab/graphql_logger_spec.rb @@ -19,15 +19,16 @@ describe Gitlab::GraphqlLogger do it 'logs a query from JSON' do analyzer_memo = { - query_string: query, - variables: {}, - complexity: 181, - depth: 0, - duration: 7 + query_string: query, + variables: {}, + complexity: 181, + depth: 0, + duration: 7 } + output = subject.format_message('INFO', now, 'test', analyzer_memo) - data = JSON.parse(output) + data = JSON.parse(output) expect(data['severity']).to eq('INFO') expect(data['time']).to eq(now.utc.iso8601(3)) expect(data['complexity']).to eq(181) |