Skip to content

Commit

Permalink
Add spec for increasing max_complexity at query time
Browse files Browse the repository at this point in the history
  • Loading branch information
riffraff authored and rmosolgo committed Jun 26, 2017
1 parent e295ba7 commit c2c33f1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/graphql/analysis/max_query_complexity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
end
end

describe "when complexity is overriden at query-level" do
describe "when max_complexity is decreased at query-level" do
before do
Dummy::Schema.max_complexity = 100
end
Expand All @@ -61,6 +61,17 @@
end
end

describe "when max_complexity is increased at query-level" do
before do
Dummy::Schema.max_complexity = 1
end
let(:result) { Dummy::Schema.execute(query_string, max_complexity: 10) }

it "doesn't error" do
assert_equal nil, result["errors"]
end
end

describe "across a multiplex" do
before do
Dummy::Schema.max_complexity = 9
Expand Down

0 comments on commit c2c33f1

Please sign in to comment.