2018-05-23 03:55:14 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'api', 'routing' do
|
|
|
|
context 'when graphql is disabled' do
|
|
|
|
before do
|
|
|
|
stub_feature_flags(graphql: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not route to the GraphqlController' do
|
2019-03-15 13:03:26 -04:00
|
|
|
expect(post('/api/graphql')).not_to route_to('graphql#execute')
|
2018-05-23 03:55:14 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-03-15 13:03:26 -04:00
|
|
|
context 'when graphql is enabled' do
|
2018-05-23 03:55:14 -04:00
|
|
|
before do
|
|
|
|
stub_feature_flags(graphql: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'routes to the GraphqlController' do
|
2019-03-15 13:03:26 -04:00
|
|
|
expect(post('/api/graphql')).to route_to('graphql#execute')
|
2018-05-23 03:55:14 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|