Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Fix ConfirmController.
Browse files Browse the repository at this point in the history
The instance variable isn't set where the view can access it on first
call - use the helper_method instead.
  • Loading branch information
tpendragon committed Jul 18, 2017
1 parent f979e66 commit f5c3b22
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/views/hyrax/confirm/state.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p>Would you like to change the state of all of the attached volumes to have the same state?</p>
</div>
<div class="form-actions panel-footer">
<%= button_to "Yes, update them", main_app.copy_state_hyrax_confirm_path(@curation_concern), class: 'btn btn-primary' %>
<%= link_to "No, I'll update them manually", [main_app, @curation_concern], class: 'btn' %>
<%= button_to "Yes, update them", main_app.copy_state_hyrax_confirm_path(curation_concern), class: 'btn btn-primary' %>
<%= link_to "No, I'll update them manually", [main_app, curation_concern], class: 'btn' %>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/hyrax/confirm/visibility.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p>Would you like to change the visibility of all of the attached volumes to have the same visibility?</p>
</div>
<div class="form-actions panel-footer">
<%= button_to "Yes, update them", main_app.copy_visibility_hyrax_confirm_path(@curation_concern), class: 'btn btn-primary' %>
<%= link_to "No, I'll update them manually", [main_app, @curation_concern], class: 'btn' %>
<%= button_to "Yes, update them", main_app.copy_visibility_hyrax_confirm_path(curation_concern), class: 'btn btn-primary' %>
<%= link_to "No, I'll update them manually", [main_app, curation_concern], class: 'btn' %>
</div>
</div>
14 changes: 14 additions & 0 deletions spec/controllers/hyrax/confirm_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
sign_in user
end

describe "#state" do
render_views
it "renders" do
get :state, params: { id: parent.id }
end
end

describe "#visibility" do
render_views
it "renders" do
get :visibility, params: { id: parent.id }
end
end

describe '#copy_state' do
it 'copies state from the parent to the member' do
expect {
Expand Down

0 comments on commit f5c3b22

Please sign in to comment.