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

pulibrary / tigerdata-app / bd039a2a-6f1b-4f1e-b08e-58dd6b70d54e

25 Nov 2025 08:28PM UTC coverage: 91.374% (+11.8%) from 79.623%
bd039a2a-6f1b-4f1e-b08e-58dd6b70d54e

Pull #2247

circleci

hectorcorrea
Added tests to the dashboard for the new data
Pull Request #2247: Display the data sponsor and data manager in the dashboard listing

1 of 3 new or added lines in 1 file covered. (33.33%)

724 existing lines in 41 files now uncovered.

2913 of 3188 relevant lines covered (91.37%)

563.89 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
UNCOV
2
class DashboardPresenter
3✔
UNCOV
3
  attr_reader :current_user
3✔
UNCOV
4
  def initialize(current_user:)
3✔
UNCOV
5
    @current_user = current_user
81✔
UNCOV
6
  end
7

UNCOV
8
  def all_projects
3✔
9
    # Short-cut to prevent an extra call to Mediaflux for non-admins
10
    # which are the large majority of our users.
11
    return [] unless current_user&.eligible_sysadmin?
7✔
12

13
    @all_projects ||= Project.all_projects(current_user)
6✔
14
                             .map { |project| ProjectDashboardPresenter.new(project, current_user) }
82✔
UNCOV
15
                             .select(&:project_in_rails?)
UNCOV
16
                             .sort_by(&:updated_at)
UNCOV
17
                             .reverse
18
    @all_projects
6✔
UNCOV
19
  end
20

UNCOV
21
  def dashboard_projects
3✔
UNCOV
22
    @dashboard_projects ||= Project.users_projects(current_user)
69✔
23
                                   .map { |project| ProjectDashboardPresenter.new(project, current_user) }
1,047✔
UNCOV
24
                                   .select(&:project_in_rails?)
UNCOV
25
                                   .sort_by(&:updated_at)
UNCOV
26
                                   .reverse
UNCOV
27
    @dashboard_projects
69✔
UNCOV
28
  end
29

UNCOV
30
  def my_inventory_requests
3✔
31
    @my_inventory_requests ||= current_user.user_requests.where(type: "FileInventoryRequest")
2✔
UNCOV
32
  end
33

UNCOV
34
  def my_draft_requests
3✔
UNCOV
35
    @my_draft_requests ||= Request.where(requested_by: current_user.uid, state: Request::DRAFT)
68✔
UNCOV
36
  end
37

UNCOV
38
  def my_submitted_requests
3✔
UNCOV
39
    @my_submitted_requests ||= Request.where(requested_by: current_user.uid, state: Request::SUBMITTED)
68✔
UNCOV
40
  end
UNCOV
41
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