Sha256: f9b7a65086876482f74c98bf703a85463be0d37c591644c2f3eba3be6686852a
Contents?: true
Size: 1.32 KB
Versions: 9
Compression:
Stored size: 1.32 KB
Contents
require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionValidators::SupportedOperationsValidator do describe '#validate!' do subject { -> { described_class.new(provided_operations: provided_operations, supported_operations: supported_operations, key: key).validate! } } let(:supported_operations) { [:operation1, :operation2, :operation3] } let(:key) { :only } context 'when custom operations are all supported' do let(:provided_operations) { [:operation2, :operation3] } it { is_expected.not_to raise_error } end context 'when no operations are provided' do let(:provided_operations) { [] } it { is_expected.not_to raise_error } end context 'when default_operations are empty' do let(:supported_operations) { [] } let(:provided_operations) { [:invalid] } it { is_expected.to raise_error(GraphqlDevise::InvalidMountOptionsError, 'only option contains unsupported operations: "invalid". Check for typos.') } end context 'when not all custom operations are supported' do let(:provided_operations) { [:operation2, :operation3, :unsupported] } it { is_expected.to raise_error(GraphqlDevise::InvalidMountOptionsError, 'only option contains unsupported operations: "unsupported". Check for typos.') } end end end
Version data entries
9 entries across 9 versions & 1 rubygems