Merge pull request #42 from opf/strong-params

Add support for strong params
pull/6827/head
Stefan Botzenhart 9 years ago
commit 0a08433f08
  1. 5
      app/controllers/documents_controller.rb
  2. 1
      features/documents_widget.feature

@ -113,4 +113,9 @@ class DocumentsController < ApplicationController
def document_params def document_params
params.require(:document).permit('category_id', 'title', 'description') params.require(:document).permit('category_id', 'title', 'description')
end end
private
def document_params
params.require(:document).permit('category_id', 'title', 'description')
end
end end

@ -40,7 +40,6 @@ Feature: Adding the document widget to personalisable pages
Scenario: Adding a "Documents" widget to the my project page Scenario: Adding a "Documents" widget to the my project page
Given the plugin "openproject_my_project_page" is loaded Given the plugin "openproject_my_project_page" is loaded
And I am on the project "project1" overview personalization page And I am on the project "project1" overview personalization page
# Safeguard to ensure the page is loaded
And I should see "Add" within "#block-select" And I should see "Add" within "#block-select"
When I select "Documents" from "block-select" When I select "Documents" from "block-select"
Then the "Documents" widget should be in the hidden block Then the "Documents" widget should be in the hidden block

Loading…
Cancel
Save