spec/rosetta_collection_spec.rb in libis-services-1.0.5 vs spec/rosetta_collection_spec.rb in libis-services-1.0.6

- old
+ new

@@ -61,14 +61,19 @@ # noinspection RubyResolve subject(:collection_service) do collection_service = Libis::Services::Rosetta::CollectionHandler.new credentials.rosetta_url, log: credentials.debug, log_level: credentials.debug_level - collection_service.pds_handle = handle + # collection_service.pds_handle = handle collection_service end + before :each do + # noinspection RubyResolve + collection_service.authenticate(credentials.admin.user, credentials.admin.password, credentials.admin.institute) + end + context 'existing collections' do let(:collection_data) { { id: '23082442', name: 'another collection', @@ -106,11 +111,11 @@ end context 'collections CRUD' do let(:collection_data) { { - name: 'New test collection', + name: 'Test API collection', parent_id: parent_id, collection_order: 0, md_dc: { type: 'descriptive', sub_type: 'dc', @@ -124,13 +129,11 @@ </dc:record> STR }, md_source: [], navigate: true, - publish: false, - external_id: '54321', - external_system: 'Scope' + publish: false } } let(:new_collection) { collection_service.find(parent_name + '/' + collection_data[:name]) } let(:new_collection_data) { @@ -171,11 +174,11 @@ expect(new_collection_id).to be_a String expect(new_collection_id).to eq new_collection.id end it 'retrieve new collection' do - puts new_collection.to_hash - puts new_collection_data + # puts new_collection.to_hash + # puts new_collection_data expect(new_collection.to_hash).to match_collection(new_collection_data) end it 'update new collection' do result = collection_service.update(updated_collection_data) \ No newline at end of file