{"action":"opened","issue":{"url":"https://api.github.com/repos/projecthydra-labs/hydra-pcdm/issues/105","labels_url":"https://api.github.com/repos/projecthydra-labs/hydra-pcdm/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/projecthydra-labs/hydra-pcdm/issues/105/comments","events_url":"https://api.github.com/repos/projecthydra-labs/hydra-pcdm/issues/105/events","html_url":"https://github.com/projecthydra-labs/hydra-pcdm/issues/105","id":77476065,"number":105,"title":"Tests that perform Add followed by Get should save and reload.","user":{"login":"elrayle","id":6855473,"avatar_url":"https://avatars.githubusercontent.com/u/6855473?v=3","gravatar_id":"","url":"https://api.github.com/users/elrayle","html_url":"https://github.com/elrayle","followers_url":"https://api.github.com/users/elrayle/followers","following_url":"https://api.github.com/users/elrayle/following{/other_user}","gists_url":"https://api.github.com/users/elrayle/gists{/gist_id}","starred_url":"https://api.github.com/users/elrayle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elrayle/subscriptions","organizations_url":"https://api.github.com/users/elrayle/orgs","repos_url":"https://api.github.com/users/elrayle/repos","events_url":"https://api.github.com/users/elrayle/events{/privacy}","received_events_url":"https://api.github.com/users/elrayle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-18T03:10:14Z","updated_at":"2015-05-18T03:10:14Z","closed_at":null,"body":"As an example, a problem with multiple objects appearing in a collection was hidden by not saving and reloading.\r\n\r\nThis passes...\r\n```\r\nit 'should allow objects to repeat' do\r\n  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )\r\n  Hydra::PCDM::AddObjectToCollection.call( subject, object2 )\r\n  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )  \r\n  expect( Hydra::PCDM::GetObjectsFromCollection.call( subject ) ).to eq [object1,object2,object1]\r\nend\r\n```\r\n\r\nThis fails...\r\n```\r\nit 'should allow objects to repeat' do\r\n  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )\r\n  Hydra::PCDM::AddObjectToCollection.call( subject, object2 )\r\n  Hydra::PCDM::AddObjectToCollection.call( subject, object1 )\r\n  subject.save\r\n  expect( Hydra::PCDM::GetObjectsFromCollection.call( subject.reload ) ).to eq [object1,object2,object1]\r\nend\r\n```\r\n"}}