diff options
Diffstat (limited to 'spec/requests/api/graphql/mutations/custom_emoji/create_spec.rb')
-rw-r--r-- | spec/requests/api/graphql/mutations/custom_emoji/create_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/api/graphql/mutations/custom_emoji/create_spec.rb b/spec/requests/api/graphql/mutations/custom_emoji/create_spec.rb index c91437fa355..66facdebe78 100644 --- a/spec/requests/api/graphql/mutations/custom_emoji/create_spec.rb +++ b/spec/requests/api/graphql/mutations/custom_emoji/create_spec.rb @@ -39,5 +39,19 @@ RSpec.describe 'Creation of a new Custom Emoji' do expect(gql_response['customEmoji']['name']).to eq(attributes[:name]) expect(gql_response['customEmoji']['url']).to eq(attributes[:url]) end + + context 'when the custom_emoji feature flag is disabled' do + before do + stub_feature_flags(custom_emoji: false) + end + + it 'does nothing and returns and error' do + expect do + post_graphql_mutation(mutation, current_user: current_user) + end.to not_change(CustomEmoji, :count) + + expect_graphql_errors_to_include('Custom emoji feature is disabled') + end + end end end |