diff --git a/spec/lib/extensions/hydra/access_controls/permissions/escaping_obsoletions_spec.rb b/spec/lib/extensions/hydra/access_controls/permissions/escaping_obsoletions_spec.rb new file mode 100644 index 00000000..319cf465 --- /dev/null +++ b/spec/lib/extensions/hydra/access_controls/permissions/escaping_obsoletions_spec.rb @@ -0,0 +1,26 @@ +require 'rails_helper' + +class EscapeMock + include ::Extensions::Hydra::AccessControls::Permission::EscapingObsoletions + +end + +describe Extensions::Hydra::AccessControls::Permission::EscapingObsoletions do + + subject { EscapeMock.new } + + pending "#agent_name" + + describe "#build_agent_resource" do + before { + allow(::CGI).to receive(:escape).with("name").and_return " de plume" + allow(::RDF::URI).to receive(:new).with("nom# de plume").and_return "alias" + allow(::Hydra::AccessControls::Agent).to receive(:new).with("alias") + } + it "calls Agent.new" do + expect(::Hydra::AccessControls::Agent).to receive(:new).with("alias") + subject.build_agent_resource "nom", "name" + end + end + +end diff --git a/spec/lib/extensions/hyrax/collections_controller/render_bookmarks_control_spec.rb b/spec/lib/extensions/hyrax/collections_controller/render_bookmarks_control_spec.rb new file mode 100644 index 00000000..73257f1f --- /dev/null +++ b/spec/lib/extensions/hyrax/collections_controller/render_bookmarks_control_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +class BookmarkMock + include ::Extensions::Hyrax::CollectionsController::RenderBookmarksControl + + def render_bookmarks_control_check? + render_bookmarks_control? + end +end + + +describe Extensions::Hyrax::CollectionsController::RenderBookmarksControl do + + subject { BookmarkMock.new } + + describe "#render_bookmarks_control?" do + it "returns false" do + expect(BookmarkMock.new.render_bookmarks_control_check?).to eq false + end + end +end diff --git a/spec/lib/extensions/qa/authorities/collections/collections_search_spec.rb b/spec/lib/extensions/qa/authorities/collections/collections_search_spec.rb new file mode 100644 index 00000000..d8080baa --- /dev/null +++ b/spec/lib/extensions/qa/authorities/collections/collections_search_spec.rb @@ -0,0 +1,28 @@ +require 'rails_helper' + +class SearchMock + include ::Extensions::Qa::Authorities::Collections::CollectionsSearch + +end + + + +describe Extensions::Qa::Authorities::Collections::CollectionsSearch do + + subject { SearchMock.new } + + describe "#search" do + context "when controller.current_user has no value" do + it "returns empty array" do + expect(subject.search "q", OpenStruct.new(current_user: nil)).to be_empty + end + end + + context "when controller.current_user has a value" do + + it "returns mapped documents" do + skip "Add a test" + end + end + end +end \ No newline at end of file