Sha256: 930938ebfac28d62dba82e606566d1a43bd4f4f6ca78e6f0f68b1e359f4a24d8
Contents?: true
Size: 1.14 KB
Versions: 14
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' describe CurationConcerns::AddToCollectionActor do let(:user) { create(:user) } let(:curation_concern) { GenericWork.new } let(:attributes) { {} } subject do CurationConcerns::ActorStack.new(curation_concern, user, [described_class, CurationConcerns::GenericWorkActor]) end describe 'the next actor' do let(:root_actor) { double } before do allow(CurationConcerns::RootActor).to receive(:new).and_return(root_actor) end let(:attributes) do { collection_ids: ['123'], title: ['test'] } end it 'does not receive the collection_ids' do expect(root_actor).to receive(:create).with(title: ['test']) subject.create(attributes) end end describe 'create' do let(:collection) { create(:collection) } let(:attributes) do { collection_ids: [collection.id], title: ['test'] } end it 'adds it to the collection' do expect(subject.create(attributes)).to be true expect(collection.reload.members).to eq [curation_concern] end end end
Version data entries
14 entries across 14 versions & 1 rubygems