Add feature flag for the GraphQL API

This commit is contained in:
Juanjo Bazán
2017-11-23 12:11:27 +01:00
committed by Javi Martín
parent bb627a7117
commit 0063e7b4d8
5 changed files with 15 additions and 0 deletions

View File

@@ -90,4 +90,13 @@ describe GraphqlController, type: :request do
expect(response).to have_http_status(:ok)
end
end
context "feature flag is set to false" do
before { Setting["feature.graphql_api"] = false }
it "is disabled" do
expect { get "/graphql" }.to raise_exception(FeatureFlags::FeatureDisabled)
expect { post "/graphql" }.to raise_exception(FeatureFlags::FeatureDisabled)
end
end
end