spec/lib/auth0/api/v2/actions_spec.rb in auth0-5.14.1 vs spec/lib/auth0/api/v2/actions_spec.rb in auth0-5.14.2

- old
+ new

@@ -13,15 +13,32 @@ it 'is expected to respond to a get_actions method' do expect(@instance).to respond_to(:get_actions) end + it 'is expected to support all optional arguments' do + expect(@instance).to receive(:get).with( + '/api/v2/actions/actions', { + triggerId: nil, + actionName: nil, + deployed: nil, + per_page: nil, + page: nil, + installed: nil + } + ) + + expect do + @instance.actions() + end.not_to raise_error + end + it 'is expected to get /api/v2/actions with custom parameters' do expect(@instance).to receive(:get).with( '/api/v2/actions/actions', { - trigger_id: 'post-login', - action_name: 'loginHandler', + triggerId: 'post-login', + actionName: 'loginHandler', deployed: true, per_page: 10, page: 1, installed: true }) @@ -35,17 +52,10 @@ installed: true ) end.not_to raise_error end - it 'is expected to raise an exception when the trigger id is empty' do - expect { @instance.actions(nil, nil) }.to raise_exception(Auth0::MissingTriggerId) - end - - it 'is expected to raise an exception when the action name is empty' do - expect { @instance.actions(1, nil) }.to raise_exception(Auth0::MissingActionName) - end end context '.action' do it 'is expected to respond to a action method' do expect(@instance).to respond_to(:action) @@ -69,10 +79,10 @@ expect(@instance).to respond_to(:create_action) end it 'is expected to post to /api/v2/actions' do expect(@instance).to receive(:post).with( - '/api/v2/actions', { + '/api/v2/actions/actions', { name: 'test_org' }) expect do @instance.create_action( name: 'test_org'