Sha256: 99ab87e44229039dcfb4ff07c0429c5727bb719c781cd18d93709cde7b24a777
Contents?: true
Size: 1.06 KB
Versions: 25
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionValidators::SkipOnlyValidator do describe '#validate!' do subject { -> { described_class.new(options: options).validate! } } context 'when only `only` key is set' do let(:options) { double(:clean_options, only: [:irrelevant], skip: []) } it { is_expected.not_to raise_error } end context 'when only `skip` key is set' do let(:options) { double(:clean_options, skip: [:irrelevant], only: []) } it { is_expected.not_to raise_error } end context 'when `skip` and `only` keys are set' do let(:options) { double(:clean_options, only: [:irrelevant], skip: [:irrelevant]) } it { is_expected.to raise_error(GraphqlDevise::InvalidMountOptionsError, "Can't specify both `skip` and `only` options when mounting the route.") } end context 'when neither `skip` nor `only are set`' do let(:options) { double(:clean_options, skip: [], only: []) } it { is_expected.not_to raise_error } end end end
Version data entries
25 entries across 25 versions & 1 rubygems