• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / 085a83f3-f8ba-4ace-b5ad-5cb6d3d55a35

24 Oct 2025 02:47PM UTC coverage: 65.148% (-26.1%) from 91.202%
085a83f3-f8ba-4ace-b5ad-5cb6d3d55a35

Pull #2057

circleci

hectorcorrea
Make test more forgiving
Pull Request #2057: Dashboard displays projects straights from Mediaflux

11 of 87 new or added lines in 4 files covered. (12.64%)

625 existing lines in 35 files now uncovered.

2088 of 3205 relevant lines covered (65.15%)

181.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/app/presenters/dashboard_presenter.rb
1
# frozen_string_literal: true
2
class DashboardPresenter
1✔
3
  attr_reader :current_user
1✔
4
  def initialize(current_user:)
1✔
5
    @current_user = current_user
5✔
6
  end
7

8
  def all_projects
1✔
9
    return [] unless current_user&.eligible_sysadmin?
3✔
10
    # Since we are now fetching the projects from Mediaflux the projects
11
    # that the user has access to is controlled by Mediaflux and therefore
12
    # "all" projects is the same as the projects shown to the user in the
13
    # dashboard.
NEW
14
    dashboard_projects
2✔
UNCOV
15
  end
16

17
  def dashboard_projects
1✔
NEW
18
    @dashboard_projects ||= Project.users_projects(current_user)
5✔
NEW
19
                                   .map { |project| ProjectDashboardPresenter.new(project) }
42✔
NEW
20
                                   .select(&:project_in_rails?)
NEW
21
                                   .sort_by(&:updated_at)
NEW
22
                                   .reverse
23
    @dashboard_projects
5✔
24
  end
25

26
  def my_inventory_requests
1✔
27
    @my_inventory_requests ||= current_user.user_requests.where(type: "FileInventoryRequest")
2✔
28
  end
29

30
  def my_draft_requests
1✔
31
    @my_draft_requests ||= Request.where(requested_by: current_user.uid, state: Request::DRAFT)
1✔
32
  end
33

34
  def my_submitted_requests
1✔
35
    @my_submitted_requests ||= Request.where(requested_by: current_user.uid, state: Request::SUBMITTED)
1✔
36
  end
37
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc