X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/060d38d627bd1e51dd2b3c6e7de9af6aa7d7b6f3..16dc8bc79da5ab7acf976184c8da51561c944dd4:/apps/workbench/test/controllers/repositories_controller_test.rb diff --git a/apps/workbench/test/controllers/repositories_controller_test.rb b/apps/workbench/test/controllers/repositories_controller_test.rb index 561723da54..b81e2384c9 100644 --- a/apps/workbench/test/controllers/repositories_controller_test.rb +++ b/apps/workbench/test/controllers/repositories_controller_test.rb @@ -63,7 +63,7 @@ class RepositoriesControllerTest < ActionController::TestCase assert_response :success panes = css_select('[data-toggle=tab]').each do |pane| - pane_name = pane.attributes['href'] + pane_name = pane.attributes['href'].value assert_includes expected_panes, pane_name end end @@ -96,7 +96,7 @@ class RepositoriesControllerTest < ActionController::TestCase commit: sha1, }, session_for(user) assert_response :success - assert_select 'pre', h(commit) + assert_select 'pre', commit end test "show blob to #{user}" do @@ -108,7 +108,7 @@ class RepositoriesControllerTest < ActionController::TestCase path: 'COPYING', }, session_for(user) assert_response :success - assert_select 'pre', h(filedata) + assert_select 'pre', filedata end end @@ -125,4 +125,20 @@ class RepositoriesControllerTest < ActionController::TestCase assert_select 'tr td', 'COPYING' end end + + test "get repositories lists linked as well as owned repositories" do + params = { + partial: :repositories_rows, + format: :json, + } + get :index, params, session_for(:active) + assert_response :success + repos = assigns(:objects) + assert repos + assert_not_empty repos, "my_repositories should not be empty" + repo_uuids = repos.map(&:uuid) + assert_includes repo_uuids, api_fixture('repositories')['repository2']['uuid'] # owned by active + assert_includes repo_uuids, api_fixture('repositories')['repository4']['uuid'] # shared with active + assert_includes repo_uuids, api_fixture('repositories')['arvados']['uuid'] # shared with all_users + end end