Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to curation_concerns 0.12.0.pre5
Fixes #1776
- Loading branch information
Showing
8 changed files
with
61 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Sufia | ||
class ActorFactory < CurationConcerns::ActorFactory | ||
def self.stack_actors(curation_concern) | ||
[CreateWithFilesActor, | ||
CurationConcerns::AddToCollectionActor, | ||
CurationConcerns::AssignRepresentativeActor, | ||
CurationConcerns::AttachFilesActor, | ||
CurationConcerns::ApplyOrderActor, | ||
CurationConcerns::InterpretVisibilityActor, | ||
model_actor(curation_concern), | ||
CurationConcerns::AssignIdentifierActor] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require 'spec_helper' | ||
|
||
describe Sufia::ActorFactory do | ||
let(:work) { GenericWork.new } | ||
let(:user) { double } | ||
|
||
describe '.stack_actors' do | ||
subject { described_class.stack_actors(work) } | ||
it { is_expected.to eq [Sufia::CreateWithFilesActor, | ||
CurationConcerns::AddToCollectionActor, | ||
CurationConcerns::AssignRepresentativeActor, | ||
CurationConcerns::AttachFilesActor, | ||
CurationConcerns::ApplyOrderActor, | ||
CurationConcerns::InterpretVisibilityActor, | ||
CurationConcerns::GenericWorkActor, | ||
CurationConcerns::AssignIdentifierActor] } | ||
end | ||
|
||
describe '.build' do | ||
subject { described_class.build(work, user) } | ||
it "has the correct stack frames" do | ||
expect(subject.more_actors).to eq [ | ||
CurationConcerns::AddToCollectionActor, | ||
CurationConcerns::AssignRepresentativeActor, | ||
CurationConcerns::AttachFilesActor, | ||
CurationConcerns::ApplyOrderActor, | ||
CurationConcerns::InterpretVisibilityActor, | ||
CurationConcerns::GenericWorkActor, | ||
CurationConcerns::AssignIdentifierActor] | ||
expect(subject.first_actor_class).to eq Sufia::CreateWithFilesActor | ||
end | ||
end | ||
|
||
describe 'CurationConcerns::CurationConcern.actor' do | ||
it "calls the Sufia::ActorFactory" do | ||
expect(described_class).to receive(:build) | ||
CurationConcerns::CurationConcern.actor(work, user) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters