diff --git a/test/integration/hearts_hooked_boards_test.rb b/test/integration/hearts_hooked_boards_test.rb index 167ad08..69fc9de 100644 --- a/test/integration/hearts_hooked_boards_test.rb +++ b/test/integration/hearts_hooked_boards_test.rb @@ -30,16 +30,16 @@ class HeartsHookedBoardsTest < Redmine::IntegrationTest def test_index_shall_not_contain_hooks get '/projects/1/boards/' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 0 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 0 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 0 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 0 assert_select '.heart-link-with-count', :count => 0 end def test_topic_view get '/boards/1/topics/1' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.message-1-heart', :count => 1 assert_select '#content > .heart-link-with-count.message-1-heart .heart-count-number', :text => "1" diff --git a/test/integration/hearts_hooked_issues_test.rb b/test/integration/hearts_hooked_issues_test.rb index 61454e0..1c4fa7a 100644 --- a/test/integration/hearts_hooked_issues_test.rb +++ b/test/integration/hearts_hooked_issues_test.rb @@ -42,8 +42,8 @@ class HeartsHookedIssuesTest < Redmine::IntegrationTest def test_index_shall_not_contain_hooks get '/projects/1/issues/' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 0 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 0 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 0 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 0 assert_select '.heart-link-with-count', :count => 0 end @@ -58,8 +58,8 @@ def test_index_with_heart_column def test_view get '/issues/1' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.issue-1-heart', :count => 1 assert_select '#content > .heart-link-with-count.issue-1-heart span.heart-count-number', :text => "0" @@ -74,8 +74,8 @@ def test_view_by_hearted_user log_user('dlopper', 'foo') get '/issues/2' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.issue-2-heart', :count => 1 assert_select '#content > .heart-link-with-count.issue-2-heart a.heart-count-number', :text => "2" diff --git a/test/integration/hearts_hooked_news_test.rb b/test/integration/hearts_hooked_news_test.rb index 6ca2eab..956ea22 100644 --- a/test/integration/hearts_hooked_news_test.rb +++ b/test/integration/hearts_hooked_news_test.rb @@ -31,8 +31,8 @@ class HeartsHookedNewsTest < Redmine::IntegrationTest def test_index get '/news/' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '.heart-link-with-count', :count => 2 assert_select '#content .news-heart-holder .heart-link-with-count.news-2-heart', :count => 1 @@ -46,8 +46,8 @@ def test_view get '/news/1' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.news-1-heart', :count => 1 assert_select '#content > .heart-link-with-count.news-1-heart span.heart-count-number', :text => "0" @@ -59,8 +59,8 @@ def test_view_by_hearted_user get '/news/1' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.news-1-heart', :count => 1 assert_select '#content > .heart-link-with-count.news-1-heart a.heart-count-number', :text => "1" diff --git a/test/integration/hearts_hooked_users_test.rb b/test/integration/hearts_hooked_users_test.rb index 6f4dcd0..8efd6fd 100644 --- a/test/integration/hearts_hooked_users_test.rb +++ b/test/integration/hearts_hooked_users_test.rb @@ -30,8 +30,8 @@ def test_show log_user('dlopper', 'foo') get '/users/1' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 0 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 0 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 0 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 0 assert_select 'a[href="/hearts/hearted_by/1"]', :count => 1, :text => "2 Likes" Heart.where(:user_id => 1).destroy_all diff --git a/test/integration/hearts_hooked_wikis_test.rb b/test/integration/hearts_hooked_wikis_test.rb index 598e8c5..4919365 100644 --- a/test/integration/hearts_hooked_wikis_test.rb +++ b/test/integration/hearts_hooked_wikis_test.rb @@ -31,8 +31,8 @@ class HeartsHookedWikisTest < Redmine::IntegrationTest def test_index_shall_not_contain_hooks get '/projects/ecookbook/wiki/index' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 0 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 0 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 0 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 0 assert_select '.heart-link-with-count', :count => 0 end @@ -41,8 +41,8 @@ def test_view get '/projects/ecookbook/wiki/CookBook_documentation' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.wiki_page-1-heart', :count => 1 assert_select '#content > .heart-link-with-count.wiki_page-1-heart span.heart-count-number', :text => "0" @@ -55,8 +55,8 @@ def test_view_by_hearted_user get '/projects/ecookbook/wiki/CookBook_documentation' assert_response :success - assert_select 'script[src*="transplant_heart_link_with_counter.js"]', :count => 1 - assert_select 'link[href*="redmine_hearts/stylesheets/application.css"]', :count => 1 + assert_select 'script:match("src", ?)', /\/redmine_hearts\/.*transplant_heart_link_with_counter.*\.js/, :count => 1 + assert_select 'link:match("href", ?)', /\/redmine_hearts\/.*application.*\.css/, :count => 1 assert_select '#content > .heart-link-with-count.wiki_page-1-heart', :count => 1 assert_select '#content > .heart-link-with-count.wiki_page-1-heart a.heart-count-number', :text => "1"