Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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