<% 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 %>
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
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