diff options
Diffstat (limited to 'test/controllers/nodes_controller_test.rb')
| -rw-r--r-- | test/controllers/nodes_controller_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/controllers/nodes_controller_test.rb b/test/controllers/nodes_controller_test.rb index 0b6e65ee..f15be067 100644 --- a/test/controllers/nodes_controller_test.rb +++ b/test/controllers/nodes_controller_test.rb | |||
| @@ -770,6 +770,20 @@ class NodesControllerTest < ActionController::TestCase | |||
| 770 | assert_select "form[action=?]", node_path(node), count: 1 | 770 | assert_select "form[action=?]", node_path(node), count: 1 |
| 771 | end | 771 | end |
| 772 | 772 | ||
| 773 | test "publishing a restricted node without the redaktion role flashes and does not publish" do | ||
| 774 | login_as :quentin | ||
| 775 | updates = Node.root.children.create!(:slug => "updates") | ||
| 776 | node = updates.children.create!(:slug => "controller-gated") | ||
| 777 | node.reload.draft.update!(:title => "Entwurf") | ||
| 778 | |||
| 779 | put :publish, params: { :id => node.id } | ||
| 780 | |||
| 781 | assert_redirected_to node_path(node) | ||
| 782 | assert_match I18n.t("activerecord.errors.models.node.attributes.base.not_permitted"), | ||
| 783 | flash[:error] | ||
| 784 | assert_nil node.reload.head | ||
| 785 | end | ||
| 786 | |||
| 773 | test "show annotates history rows with their lifecycle" do | 787 | test "show annotates history rows with their lifecycle" do |
| 774 | login_as :quentin | 788 | login_as :quentin |
| 775 | node = Node.root.children.create!(:slug => "history_annotation_test") | 789 | node = Node.root.children.create!(:slug => "history_annotation_test") |
