Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide the apropriate header for edit a work
Don't show the link to switch to batch upload when Editing.
- Loading branch information
Showing
6 changed files
with
66 additions
and
22 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,6 @@ | ||
<% provide :page_title, curation_concern_page_title(curation_concern) %> | ||
<% provide :page_header do %> | ||
<h2><%= t("sufia.#{controller_name}.#{action_name}.header") %></h2> | ||
<% end %> | ||
<%= render 'form' %> |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<h1><%= t("sufia.#{controller_name}.#{action_name}.header") %></h1> | ||
<% provide :page_title, curation_concern_page_title(curation_concern) %> | ||
<% provide :page_header do %> | ||
<h2><%= t("sufia.#{controller_name}.#{action_name}.header") %></h2> | ||
<% end %> | ||
<%= render 'form' %> |
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,27 @@ | ||
require 'spec_helper' | ||
|
||
describe 'curation_concerns/base/edit.html.erb' do | ||
let(:work) { stub_model(GenericWork, id: '456', title: ["A nice work"]) } | ||
let(:ability) { double } | ||
|
||
let(:form) do | ||
CurationConcerns::GenericWorkForm.new(work, ability) | ||
end | ||
|
||
before do | ||
view.lookup_context.view_paths.push 'app/views/curation_concerns' | ||
allow(view).to receive(:curation_concern).and_return(work) | ||
allow(controller).to receive(:current_user).and_return(stub_model(User)) | ||
assign(:form, form) | ||
view.controller = CurationConcerns::GenericWorksController.new | ||
view.controller.action_name = 'edit' | ||
stub_template "curation_concerns/base/_form.html.erb" => 'a form' | ||
end | ||
|
||
it "sets a header and draws the form" do | ||
expect(view).to receive(:provide).with(:page_title, 'A nice work // Generic Work [456] // Sufia') | ||
expect(view).to receive(:provide).with(:page_header).and_yield | ||
render | ||
expect(rendered).to eq " <h2>Edit Work</h2>\n\na form\n" | ||
end | ||
end |