spec/scim_spec.rb in cf-uaa-lib-4.0.3 vs spec/scim_spec.rb in cf-uaa-lib-4.0.4

- old
+ new

@@ -158,9 +158,33 @@ end result = subject.change_secret('id12345', 'newpwd', 'oldpwd') result['id'].should == 'id12345' end + it "add a client's jwt trust using jwks_uri" do + subject.set_request_handler do |url, method, body, headers| + url.should == "#{@target}/oauth/clients/id12345/clientjwt" + method.should == :put + check_headers(headers, :json, :json, nil) + body.should include('"jwks_uri":"http://localhost:8080/uaa/token_keys"') + [200, '{"id":"id12345"}', {'content-type' => 'application/json'}] + end + result = subject.change_clientjwt('id12345', 'http://localhost:8080/uaa/token_keys') + result['id'].should == 'id12345' + end + + it "add a client's jwt trust using jwks" do + subject.set_request_handler do |url, method, body, headers| + url.should == "#{@target}/oauth/clients/id12345/clientjwt" + method.should == :put + check_headers(headers, :json, :json, nil) + body.should include('"jwks":"keys"') + [200, '{"id":"id12345"}', {'content-type' => 'application/json'}] + end + result = subject.change_clientjwt('id12345', nil, 'keys') + result['id'].should == 'id12345' + end + it 'unlocks a user' do subject.set_request_handler do |url, method, body, headers| url.should == "#{@target}/Users/id12345/status" method.should == :patch check_headers(headers, :json, :json, nil)