-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from pulibrary/i230-bugfix
Pre-pend deploy subdirectory to metadata links
- Loading branch information
Showing
2 changed files
with
53 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe ApplicationHelper, type: :helper do | ||
describe "#render_field_row_search_link" do | ||
let(:title) { "Domain" } | ||
let(:value) { "Humanities" } | ||
let(:field) { "domain_ssi" } | ||
let(:search_link) { helper.search_link(value, field) } | ||
let(:rendered_search_link) { helper.render_field_row_search_link(title, value, field) } | ||
|
||
it "creates a search link" do | ||
expect(rendered_search_link).to match(title) | ||
expect(rendered_search_link).to match(value) | ||
expect(rendered_search_link).to match(field) | ||
end | ||
|
||
# config.assets.prefix = "/discovery/assets/" | ||
context "when there is an assets prefix" do | ||
around do |example| | ||
Rails.application.config.assets.prefix = "/discovery/assets/" | ||
example.run | ||
Rails.application.config.assets.prefix = "/assets/" | ||
end | ||
|
||
it "pre-pends the link" do | ||
expect(search_link).to eq "/discovery/?f[domain_ssi][]=Humanities&q=&search_field=all_fields" | ||
end | ||
end | ||
|
||
context "when there is not an assets prefix" do | ||
it "does not pre-pend the link" do | ||
expect(search_link).to eq "/?f[domain_ssi][]=Humanities&q=&search_field=all_fields" | ||
end | ||
end | ||
end | ||
end |