diff options
Diffstat (limited to 'spec/finders/clusters/agent_tokens_finder_spec.rb')
-rw-r--r-- | spec/finders/clusters/agent_tokens_finder_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/finders/clusters/agent_tokens_finder_spec.rb b/spec/finders/clusters/agent_tokens_finder_spec.rb index 024e567a16e..1f5bfd58e85 100644 --- a/spec/finders/clusters/agent_tokens_finder_spec.rb +++ b/spec/finders/clusters/agent_tokens_finder_spec.rb @@ -44,6 +44,15 @@ RSpec.describe Clusters::AgentTokensFinder do it { is_expected.to match_array(revoked_agent_tokens) } end + context 'when filtering by an unrecognised status' do + subject(:execute) { described_class.new(agent, user, status: 'dummy').execute } + + it 'raises an error' do + # 'dummy' is not a valid status as defined in the AgentToken status enum + expect { execute.count }.to raise_error(ActiveRecord::StatementInvalid) + end + end + context 'when user does not have permission' do let(:user) { create(:user) } |