From: radhika Date: Fri, 12 Feb 2016 19:03:57 +0000 (-0500) Subject: 8286: add an integration test to star / unstar project by clicking on the icon. X-Git-Tag: 1.1.0~1107^2~9 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/3e515256d1ce0c7c09f4f8454f9761f261fb8b71 8286: add an integration test to star / unstar project by clicking on the icon. --- diff --git a/apps/workbench/app/views/projects/show.html.erb b/apps/workbench/app/views/projects/show.html.erb index 2b0a5740e4..0f9df7693f 100644 --- a/apps/workbench/app/views/projects/show.html.erb +++ b/apps/workbench/app/views/projects/show.html.erb @@ -6,11 +6,11 @@ <% starred = false %> <% starred = true if is_starred %> <% if starred %> - <%= link_to(url_for({action: 'star', status: 'delete', id: @object.uuid, controller: 'projects'}), method: :post, class: "btn btn-xs", title: "Undo favorite") do %> + <%= link_to(url_for({action: 'star', status: 'delete', id: @object.uuid, controller: 'projects'}), method: :post, class: "btn btn-xs", title: "Remove from list of favorites") do %> <% end %> <% else %> - <%= link_to(url_for({action: 'star', status: 'create', id: @object.uuid, controller: 'projects'}), method: :post, class: "btn btn-xs", title: "Mark favorite") do %> + <%= link_to(url_for({action: 'star', status: 'create', id: @object.uuid, controller: 'projects'}), method: :post, class: "btn btn-xs", title: "Add to list of favorites") do %> <% end %> <% end %> diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb index 64a547108b..5a71b76408 100644 --- a/apps/workbench/test/integration/projects_test.rb +++ b/apps/workbench/test/integration/projects_test.rb @@ -709,4 +709,23 @@ class ProjectsTest < ActionDispatch::IntegrationTest assert page.has_text?('Unrestricted public data'), 'No text - Unrestricted public data' assert page.has_text?('An anonymously accessible project'), 'No text - An anonymously accessible project' end + + test "test star and unstar project" do + visit page_with_token 'active', "/projects/#{api_fixture('groups')['anonymously_accessible_project']['uuid']}" + + # add to favorites + find('.fa-star-o').click + + find("#projects-menu").click + within('.dropdown-menu') do + assert_selector 'li', text: 'Unrestricted public data' + end + + # remove from favotires + find('.fa-star').click + find("#projects-menu").click + within('.dropdown-menu') do + assert_no_selector 'li', text: 'Unrestricted public data' + end + end end diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb index 98c06ea43e..6623c726df 100644 --- a/services/api/test/functional/arvados/v1/groups_controller_test.rb +++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb @@ -423,16 +423,4 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase end assert_equal true, found_projects.include?(groups(:starred_and_shared_active_user_project).uuid) end - - test "deleting a project results in deleting it's star links" do - skip "Delete is not yet supported for groups with share and other links" - - authorize_with :admin - post :destroy, id: groups(:starred_and_shared_active_user_project).uuid - assert_response :success - - @controller = Arvados::V1::LinksController.new - get :show, {id: links(:star_shared_project_for_project_viewer).uuid} - assert_response 404 - end end