Commit 089d1bb

mokha <mokha@cisco.com>
2019-01-11 18:15:18
add a blank description
1 parent eed78fa
Changed files (3)
lib
spec
scim
lib/scim/kit/v2/attribute_type.rb
@@ -108,7 +108,6 @@ module Scim
 
         def valid?(value)
           if complex?
-
             if multi_valued
               return false unless value.respond_to?(:each)
 
lib/scim/kit/v2/schema.rb
@@ -13,6 +13,7 @@ module Scim
         def initialize(id:, name:, location:)
           @id = id
           @name = name
+          @description = ''
           @meta = Meta.new('Schema', location)
           @meta.created = @meta.last_modified = @meta.version = nil
           @attributes = []
spec/scim/kit/v2/schema_spec.rb
@@ -9,16 +9,20 @@ RSpec.describe Scim::Kit::V2::Schema do
   let(:description) { FFaker::Name.name }
   let(:result) { JSON.parse(subject.to_json, symbolize_names: true) }
 
-  before do
-    subject.description = description
-  end
-
   specify { expect(result[:id]).to eql(id) }
   specify { expect(result[:name]).to eql(name) }
-  specify { expect(result[:description]).to eql(description) }
+  specify { expect(result[:description]).to eql('') }
   specify { expect(result[:meta][:resourceType]).to eql('Schema') }
   specify { expect(result[:meta][:location]).to eql(location) }
 
+  context "with a description" do
+    before do
+      subject.description = description
+    end
+
+    specify { expect(result[:description]).to eql(description) }
+  end
+
   context 'with a single simple attribute' do
     before do
       subject.add_attribute(name: 'displayName')