-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a link to the CSV template in the Field Guide (#116)
Ensure the user can download the current version of the CSV template file from the Metadata Field Guide. Also adds additional formatting enhancements to the Field Guide.
- Loading branch information
Showing
3 changed files
with
56 additions
and
9 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,30 @@ | ||
# frozen_string_literal: true | ||
require 'rails_helper' | ||
|
||
RSpec.describe "zizia/metadata_details/show.html.erb", type: :view do | ||
before do | ||
assign(:details, [{ | ||
attribute: 'title', | ||
label: 'Title', | ||
csv_header: 'title', | ||
predicate: 'n/a', | ||
multiple: 'true', | ||
type: 'String', | ||
validator: 'n/a', | ||
required_on_form: 'true', | ||
usage: 'none' | ||
}]) | ||
assign(:delimiter, '|') | ||
allow(view).to receive(:importer_documentation_csv_path).and_return('./csv') | ||
end | ||
|
||
it 'renders as html' do | ||
render | ||
expect(rendered).to match(/<h3 class="field-label">\s*Title\s*<\/h3>/) | ||
end | ||
|
||
it 'provides a link to the import template' do | ||
render | ||
expect(rendered).to have_link("import_template", href: './csv') | ||
end | ||
end |