summaryrefslogtreecommitdiffstats
path: root/test/integration/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-22 09:38:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-22 09:38:21 +0000
commitf3e573b5f891c71f9395562a3f8747ecec801091 (patch)
tree7987fd3efa8ae985b532a03e7e0f529fa997258d /test/integration/lib
parent3602cd637c9ece4e0caa42c335acb7dce719a20e (diff)
downloadredmine-f3e573b5f891c71f9395562a3f8747ecec801091.tar.gz
redmine-f3e573b5f891c71f9395562a3f8747ecec801091.zip
Replaced remaining #assert_tag with #assert_select.
git-svn-id: http://svn.redmine.org/redmine/trunk@13624 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/lib')
-rw-r--r--test/integration/lib/redmine/hook_test.rb3
-rw-r--r--test/integration/lib/redmine/menu_manager_test.rb30
2 files changed, 11 insertions, 22 deletions
diff --git a/test/integration/lib/redmine/hook_test.rb b/test/integration/lib/redmine/hook_test.rb
index f0520b58e..9e5c5bbb1 100644
--- a/test/integration/lib/redmine/hook_test.rb
+++ b/test/integration/lib/redmine/hook_test.rb
@@ -76,8 +76,7 @@ VIEW
Redmine::Hook.add_listener(ProjectBasedTemplate)
get '/projects/ecookbook'
- assert_tag :tag => 'link', :attributes => {:href => '/stylesheets/ecookbook.css'},
- :parent => {:tag => 'head'}
+ assert_select 'head link[href=?]', '/stylesheets/ecookbook.css'
end
def test_empty_sidebar_should_be_hidden
diff --git a/test/integration/lib/redmine/menu_manager_test.rb b/test/integration/lib/redmine/menu_manager_test.rb
index 5d3826a23..bc4fbf017 100644
--- a/test/integration/lib/redmine/menu_manager_test.rb
+++ b/test/integration/lib/redmine/menu_manager_test.rb
@@ -31,14 +31,10 @@ class MenuManagerTest < ActionDispatch::IntegrationTest
def test_project_menu_with_specific_locale
get 'projects/ecookbook/issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'
- assert_tag :div, :attributes => { :id => 'main-menu' },
- :descendant => { :tag => 'li', :child => { :tag => 'a', :content => ll('fr', :label_activity),
- :attributes => { :href => '/projects/ecookbook/activity',
- :class => 'activity' } } }
- assert_tag :div, :attributes => { :id => 'main-menu' },
- :descendant => { :tag => 'li', :child => { :tag => 'a', :content => ll('fr', :label_issue_plural),
- :attributes => { :href => '/projects/ecookbook/issues',
- :class => 'issues selected' } } }
+ assert_select 'div#main-menu' do
+ assert_select 'li a.activity[href=?]', '/projects/ecookbook/activity', :text => ll('fr', :label_activity)
+ assert_select 'li a.issues.selected[href=?]', '/projects/ecookbook/issues', :text => ll('fr', :label_issue_plural)
+ end
end
def test_project_menu_with_additional_menu_items
@@ -51,19 +47,13 @@ class MenuManagerTest < ActionDispatch::IntegrationTest
end
get 'projects/ecookbook'
- assert_tag :div, :attributes => { :id => 'main-menu' },
- :descendant => { :tag => 'li', :child => { :tag => 'a', :content => 'Foo',
- :attributes => { :class => 'foo' } } }
-
- assert_tag :div, :attributes => { :id => 'main-menu' },
- :descendant => { :tag => 'li', :child => { :tag => 'a', :content => 'Bar',
- :attributes => { :class => 'bar' } },
- :before => { :tag => 'li', :child => { :tag => 'a', :content => 'ECOOKBOOK' } } }
- assert_tag :div, :attributes => { :id => 'main-menu' },
- :descendant => { :tag => 'li', :child => { :tag => 'a', :content => 'ECOOKBOOK',
- :attributes => { :class => 'hello' } },
- :before => { :tag => 'li', :child => { :tag => 'a', :content => 'Activity' } } }
+ assert_select 'div#main-menu ul' do
+ assert_select 'li:last-child a.foo[href=?]', '/projects/ecookbook', :text => 'Foo'
+ assert_select 'li:nth-child(2) a.bar[href=?]', '/projects/ecookbook', :text => 'Bar'
+ assert_select 'li:nth-child(3) a.hello[href=?]', '/projects/ecookbook', :text => 'ECOOKBOOK'
+ assert_select 'li:nth-child(4) a', :text => 'Activity'
+ end
# Remove the menu items
Redmine::MenuManager.map :project_menu do |menu|