spec/scim_spec.rb in cf-uaa-lib-2.1.0 vs spec/scim_spec.rb in cf-uaa-lib-3.0.0
- old
+ new
@@ -34,16 +34,20 @@
headers["accept"].should be_nil unless accept
headers["authorization"].should =~ /^(?i:bearer)\s+xyz$/
end
describe "initialize" do
- let(:options) { {:http_proxy => 'http-proxy.com', :https_proxy => 'https-proxy.com'} }
+ let(:options) { {:http_proxy => 'http-proxy.com', :https_proxy => 'https-proxy.com', :skip_ssl_validation => true} }
it "sets proxy information" do
subject.http_proxy.should == 'http-proxy.com'
subject.https_proxy.should == 'https-proxy.com'
end
+
+ it "sets skip_ssl_validation" do
+ subject.skip_ssl_validation == true
+ end
end
it "adds an object" do
subject.set_request_handler do |url, method, body, headers|
url.should == "#{@target}/Users"
@@ -65,9 +69,23 @@
check_headers(headers, :json, :json)
headers["if-match"].should == "v567"
[200, '{"ID":"id12345"}', {"content-type" => "application/json"}]
end
result = subject.put(:user, obj)
+ result["id"].should == "id12345"
+ end
+
+ it "modifies an object" do
+ obj = {:hair => "black", :shoe_size => "medium", :eye_color => ["hazel", "brown"],
+ :name => "fredrick", :meta => {:version => 'v567'}, :id => "id12345"}
+ subject.set_request_handler do |url, method, body, headers|
+ url.should == "#{@target}/Users/id12345"
+ method.should == :patch
+ check_headers(headers, :json, :json)
+ headers["if-match"].should == "v567"
+ [200, '{"ID":"id12345"}', {"content-type" => "application/json"}]
+ end
+ result = subject.patch(:user, obj)
result["id"].should == "id12345"
end
it "gets an object" do
subject.set_request_handler do |url, method, body, headers|