From: Toshi MARUYAMA Date: Fri, 20 Nov 2020 11:36:22 +0000 (+0000) Subject: remove spaces inside {} of test/unit/lib/redmine/menu_manager/mapper_test.rb X-Git-Tag: 4.2.0~371 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=207fbe3e78a5c68a1d231bda39d131d477d80deb;p=redmine.git remove spaces inside {} of test/unit/lib/redmine/menu_manager/mapper_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20447 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/lib/redmine/menu_manager/mapper_test.rb b/test/unit/lib/redmine/menu_manager/mapper_test.rb index 6e1badd16..2cb129d41 100644 --- a/test/unit/lib/redmine/menu_manager/mapper_test.rb +++ b/test/unit/lib/redmine/menu_manager/mapper_test.rb @@ -35,15 +35,15 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_push_onto_root menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} menu_mapper.exists?(:test_overview) end def test_push_onto_parent menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_child, { :controller => 'projects', :action => 'show'}, {:parent => :test_overview} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_child, {:controller => 'projects', :action => 'show'}, {:parent => :test_overview} assert menu_mapper.exists?(:test_child) assert_equal :test_child, menu_mapper.find(:test_child).name @@ -51,9 +51,9 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_push_onto_grandparent menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_child, { :controller => 'projects', :action => 'show'}, {:parent => :test_overview} - menu_mapper.push :test_grandchild, { :controller => 'projects', :action => 'show'}, {:parent => :test_child} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_child, {:controller => 'projects', :action => 'show'}, {:parent => :test_overview} + menu_mapper.push :test_grandchild, {:controller => 'projects', :action => 'show'}, {:parent => :test_child} assert menu_mapper.exists?(:test_grandchild) grandchild = menu_mapper.find(:test_grandchild) @@ -63,11 +63,11 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_push_first menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_second, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_third, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fourth, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fifth, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_first, { :controller => 'projects', :action => 'show'}, {:first => true} + menu_mapper.push :test_second, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_third, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fourth, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fifth, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_first, {:controller => 'projects', :action => 'show'}, {:first => true} root = menu_mapper.find(:root) assert_equal 5, root.children.size @@ -80,11 +80,11 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_push_before menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_first, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_second, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fourth, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fifth, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_third, { :controller => 'projects', :action => 'show'}, {:before => :test_fourth} + menu_mapper.push :test_first, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_second, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fourth, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fifth, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_third, {:controller => 'projects', :action => 'show'}, {:before => :test_fourth} root = menu_mapper.find(:root) assert_equal 5, root.children.size @@ -97,11 +97,11 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_push_after menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_first, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_second, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_third, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fifth, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fourth, { :controller => 'projects', :action => 'show'}, {:after => :test_third} + menu_mapper.push :test_first, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_second, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_third, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fifth, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fourth, {:controller => 'projects', :action => 'show'}, {:after => :test_third} root = menu_mapper.find(:root) assert_equal 5, root.children.size @@ -114,11 +114,11 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_push_last menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_first, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_second, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_third, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_fifth, { :controller => 'projects', :action => 'show'}, {:last => true} - menu_mapper.push :test_fourth, { :controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_first, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_second, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_third, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_fifth, {:controller => 'projects', :action => 'show'}, {:last => true} + menu_mapper.push :test_fourth, {:controller => 'projects', :action => 'show'}, {} root = menu_mapper.find(:root) assert_equal 5, root.children.size @@ -131,22 +131,22 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_exists_for_child_node menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} - menu_mapper.push :test_child, { :controller => 'projects', :action => 'show'}, {:parent => :test_overview } + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_child, {:controller => 'projects', :action => 'show'}, {:parent => :test_overview} assert menu_mapper.exists?(:test_child) end def test_exists_for_invalid_node menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} assert !menu_mapper.exists?(:nothing) end def test_find menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} item = menu_mapper.find(:test_overview) assert_equal :test_overview, item.name @@ -155,7 +155,7 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_find_missing menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} item = menu_mapper.find(:nothing) assert_nil item @@ -163,7 +163,7 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase def test_delete menu_mapper = Redmine::MenuManager::Mapper.new(:test_menu, {}) - menu_mapper.push :test_overview, { :controller => 'projects', :action => 'show'}, {} + menu_mapper.push :test_overview, {:controller => 'projects', :action => 'show'}, {} assert_not_nil menu_mapper.delete(:test_overview) assert_nil menu_mapper.find(:test_overview) @@ -178,14 +178,14 @@ class Redmine::MenuManager::MapperTest < ActiveSupport::TestCase # Exposed by deleting :last items Redmine::MenuManager.map :test_menu do |menu| menu.push :not_last, Redmine::Info.help_url - menu.push :administration, { :controller => 'projects', :action => 'show'}, {:last => true} + menu.push :administration, {:controller => 'projects', :action => 'show'}, {:last => true} menu.push :help, Redmine::Info.help_url, :last => true end assert_nothing_raised do Redmine::MenuManager.map :test_menu do |menu| menu.delete(:administration) menu.delete(:help) - menu.push :test_overview, { :controller => 'projects', :action => 'show'}, {} + menu.push :test_overview, {:controller => 'projects', :action => 'show'}, {} end end end