From: Tom Clegg Date: Mon, 14 Mar 2016 19:54:32 +0000 (-0400) Subject: Fix ineffective test case X-Git-Tag: 1.1.0~1062 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/2324d45d702c454057558919be2f598f416e9f91?ds=sidebyside Fix ineffective test case No issue # --- diff --git a/services/api/test/functional/arvados/v1/repositories_controller_test.rb b/services/api/test/functional/arvados/v1/repositories_controller_test.rb index 241a34eb10..71b528e72a 100644 --- a/services/api/test/functional/arvados/v1/repositories_controller_test.rb +++ b/services/api/test/functional/arvados/v1/repositories_controller_test.rb @@ -197,10 +197,10 @@ class Arvados::V1::RepositoriesControllerTest < ActionController::TestCase end [ - {cfg: :git_repo_ssh_base, cfgval: "git@example.com:", match: %r"^git@example.com:/"}, - {cfg: :git_repo_ssh_base, cfgval: true, match: %r"^git@git.zzzzz.arvadosapi.com:/"}, + {cfg: :git_repo_ssh_base, cfgval: "git@example.com:", match: %r"^git@example.com:"}, + {cfg: :git_repo_ssh_base, cfgval: true, match: %r"^git@git.zzzzz.arvadosapi.com:"}, {cfg: :git_repo_ssh_base, cfgval: false, refute: /^git@/ }, - {cfg: :git_repo_https_base, cfgval: "https://example.com/", match: %r"https://example.com/"}, + {cfg: :git_repo_https_base, cfgval: "https://example.com/", match: %r"^https://example.com/"}, {cfg: :git_repo_https_base, cfgval: true, match: %r"^https://git.zzzzz.arvadosapi.com/"}, {cfg: :git_repo_https_base, cfgval: false, refute: /^http/ }, ].each do |expect| @@ -209,15 +209,17 @@ class Arvados::V1::RepositoriesControllerTest < ActionController::TestCase authorize_with :active get :index assert_response :success + assert_not_empty json_response['items'] json_response['items'].each do |r| if expect[:refute] r['clone_urls'].each do |u| refute_match expect[:refute], u end else - assert r['clone_urls'].any? do |u| - expect[:prefix].match u - end + assert((r['clone_urls'].any? do |u| + expect[:match].match u + end), + "no match for #{expect[:match]} in #{r['clone_urls'].inspect}") end end end