diff --git a/app/controllers/sections_controller.rb b/app/controllers/sections_controller.rb index bb98094..146391f 100644 --- a/app/controllers/sections_controller.rb +++ b/app/controllers/sections_controller.rb @@ -21,7 +21,9 @@ #update a section of a template def admin_update @section = Section.includes(phase: :template).find(params[:id]) +puts "HERE" authorize @section +puts "THERE" @section.description = params["section-desc-#{params[:id]}"] @phase = @section.phase if @section.update_attributes(params[:section]) diff --git a/test/functional/sections_controller_test.rb b/test/functional/sections_controller_test.rb index 53362ff..fc66138 100644 --- a/test/functional/sections_controller_test.rb +++ b/test/functional/sections_controller_test.rb @@ -68,6 +68,10 @@ put admin_update_section_path(@phase.sections.first), {section: params} assert_unauthorized_redirect_to_root_path +puts "USER ORG: #{@user.org.abbreviation} (can org admin? #{@user.can_org_admin?})" +puts "TMPLT ORG: #{@template.org.abbreviation}" +puts "PHASE ORG: #{@phase.template.org.abbreviation}" + sign_in @user # Valid save