summaryrefslogtreecommitdiff
path: root/test/controllers/nodes_controller_test.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-25 03:51:44 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-25 03:51:44 +0200
commitbaace1fa5df46694ddd515dc3bbca59b22df8692 (patch)
tree6a8b587ca5d6d38377fe132b02c857f1c4149231 /test/controllers/nodes_controller_test.rb
parented32bc6902ab634451539770bcd910662212e01a (diff)
Extract flashes to i18n and stop dispatching on submit labels
Diffstat (limited to 'test/controllers/nodes_controller_test.rb')
-rw-r--r--test/controllers/nodes_controller_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/controllers/nodes_controller_test.rb b/test/controllers/nodes_controller_test.rb
index 8b59fc37..d7a3abbd 100644
--- a/test/controllers/nodes_controller_test.rb
+++ b/test/controllers/nodes_controller_test.rb
@@ -91,7 +91,7 @@ class NodesControllerTest < ActionController::TestCase
91 node = Node.last 91 node = Node.last
92 assert_includes node.draft.assets, asset 92 assert_includes node.draft.assets, asset
93 assert_equal asset, node.draft.headline_asset 93 assert_equal asset, node.draft.headline_asset
94 assert_match /attached/, flash[:notice] 94 assert_equal I18n.t("flash.nodes.created_with_attachment", :name => "Birth attachment") + " " + I18n.t("flash.common.now_headline"), flash[:notice]
95 end 95 end
96 96
97 test "the attach notice survives the redirect into the editor" do 97 test "the attach notice survives the redirect into the editor" do
@@ -104,8 +104,8 @@ class NodesControllerTest < ActionController::TestCase
104 104
105 get :edit, params: { :id => Node.last.id } 105 get :edit, params: { :id => Node.last.id }
106 assert_response :success 106 assert_response :success
107 assert_match /attached/, flash[:notice] 107 assert_equal I18n.t("flash.nodes.created_with_attachment", :name => "Flash survivor"), flash[:notice]
108 assert_no_match /ready to edit/, flash[:notice] 108 assert_not_equal I18n.t("flash.nodes.locked_ready"), flash[:notice]
109 end 109 end
110 110
111 test "editing a node" do 111 test "editing a node" do
@@ -146,7 +146,7 @@ class NodesControllerTest < ActionController::TestCase
146 146
147 get :edit, params: { :id => node.id } 147 get :edit, params: { :id => node.id }
148 assert_response :redirect 148 assert_response :redirect
149 assert flash[:error] =~ /Page is locked by another user/ 149 assert_equal I18n.t("flash.common.locked_by_other"), flash[:error]
150 end 150 end
151 151
152 def test_update_a_draft 152 def test_update_a_draft
@@ -282,7 +282,7 @@ class NodesControllerTest < ActionController::TestCase
282 282
283 put :unlock, params: { :id => node.id } 283 put :unlock, params: { :id => node.id }
284 assert_response :redirect 284 assert_response :redirect
285 assert_equal "Already unlocked", flash[:notice] 285 assert_equal I18n.t("flash.nodes.already_unlocked"), flash[:notice]
286 end 286 end
287 287
288 test "updating a node by changing its parent" do 288 test "updating a node by changing its parent" do