From baace1fa5df46694ddd515dc3bbca59b22df8692 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 03:51:44 +0200 Subject: Extract flashes to i18n and stop dispatching on submit labels --- test/controllers/nodes_controller_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/controllers/nodes_controller_test.rb') 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 node = Node.last assert_includes node.draft.assets, asset assert_equal asset, node.draft.headline_asset - assert_match /attached/, flash[:notice] + assert_equal I18n.t("flash.nodes.created_with_attachment", :name => "Birth attachment") + " " + I18n.t("flash.common.now_headline"), flash[:notice] end test "the attach notice survives the redirect into the editor" do @@ -104,8 +104,8 @@ class NodesControllerTest < ActionController::TestCase get :edit, params: { :id => Node.last.id } assert_response :success - assert_match /attached/, flash[:notice] - assert_no_match /ready to edit/, flash[:notice] + assert_equal I18n.t("flash.nodes.created_with_attachment", :name => "Flash survivor"), flash[:notice] + assert_not_equal I18n.t("flash.nodes.locked_ready"), flash[:notice] end test "editing a node" do @@ -146,7 +146,7 @@ class NodesControllerTest < ActionController::TestCase get :edit, params: { :id => node.id } assert_response :redirect - assert flash[:error] =~ /Page is locked by another user/ + assert_equal I18n.t("flash.common.locked_by_other"), flash[:error] end def test_update_a_draft @@ -282,7 +282,7 @@ class NodesControllerTest < ActionController::TestCase put :unlock, params: { :id => node.id } assert_response :redirect - assert_equal "Already unlocked", flash[:notice] + assert_equal I18n.t("flash.nodes.already_unlocked"), flash[:notice] end test "updating a node by changing its parent" do -- cgit v1.3