8286: add an integration test to star / unstar project by clicking on the icon.
authorradhika <radhika@curoverse.com>
Fri, 12 Feb 2016 19:03:57 +0000 (14:03 -0500)
committerradhika <radhika@curoverse.com>
Fri, 12 Feb 2016 19:03:57 +0000 (14:03 -0500)
apps/workbench/app/views/projects/show.html.erb
apps/workbench/test/integration/projects_test.rb
services/api/test/functional/arvados/v1/groups_controller_test.rb

index 2b0a5740e42560ea7cf4ca0d1b08d6f6a7cf1687..0f9df7693f11c57e9ab87804a440dca1db7a8070 100644 (file)
@@ -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 %>
             <i class="fa fa-fw fa-star"></i>
           <% 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 %>
             <i class="fa fa-fw fa-star-o"></i>
           <% end %>
       <% end %>
index 64a547108bc3e50157a0bebed23392728c83ee45..5a71b76408f3b40ce0335928d824f89a50210ab2 100644 (file)
@@ -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
index 98c06ea43ef23a075ef5fa6ca8cfe6d9ea65426e..6623c726df01923b7227d33f17e6f2098cab649e 100644 (file)
@@ -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