Commit f5c6b09

mokha <mokha@cisco.com>
2018-01-22 19:13:51
add builder interface to SP config.
1 parent ec1410a
lib/scim/shady/service_provider_configuration.rb
@@ -1,6 +1,8 @@
 module Scim
   module Shady
     class ServiceProviderConfiguration
+      include Buildable
+
       def initialize(json)
         @json = json
       end
@@ -60,6 +62,10 @@ module Scim
       def to_json
         @json
       end
+
+      def self.builder_class
+        Scim::Shady::Builders::ServiceProviderConfiguration
+      end
     end
   end
 end
spec/scim/service_provider_configuration_spec.rb
@@ -0,0 +1,19 @@
+RSpec.describe Scim::Shady::ServiceProviderConfiguration do
+  describe ".build" do
+    subject { described_class }
+
+    it 'builds a configuration' do
+      result = subject.build do |builder|
+        builder.bulk do |x|
+          x.supported = true
+          x.max_operations = 1_000
+          x.max_payload_size = 1_048_576
+        end
+      end
+
+      expect(result.bulk_supported).to be(true)
+      expect(result.bulk_max_operations).to eql(1_000)
+      expect(result.bulk_max_payload_size).to eql(1_048_576)
+    end
+  end
+end