Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests that perform Add followed by Get should save and reload. #105

Open
elrayle opened this issue May 18, 2015 · 0 comments
Open

Tests that perform Add followed by Get should save and reload. #105

elrayle opened this issue May 18, 2015 · 0 comments
Labels

Comments

@elrayle
Copy link
Contributor

elrayle commented May 18, 2015

As an example, a problem with multiple objects appearing in a collection was hidden by not saving and reloading.

This passes...

it 'should allow objects to repeat' do
  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )
  Hydra::PCDM::AddObjectToCollection.call( subject, object2 )
  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )  
  expect( Hydra::PCDM::GetObjectsFromCollection.call( subject ) ).to eq [object1,object2,object1]
end

This fails...

it 'should allow objects to repeat' do
  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )
  Hydra::PCDM::AddObjectToCollection.call( subject, object2 )
  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )
  subject.save
  expect( Hydra::PCDM::GetObjectsFromCollection.call( subject.reload ) ).to eq [object1,object2,object1]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

3 participants