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

pulibrary / tigerdata-app / 8d70f2ab-acc5-4aab-b64b-743d66ddd2eb

29 Aug 2025 06:22PM UTC coverage: 87.983% (-0.1%) from 88.118%
8d70f2ab-acc5-4aab-b64b-743d66ddd2eb

Pull #1801

circleci

JaymeeH
Merge branch '1586-request-mailer' of https://github.com/pulibrary/tiger-data-app into 1586-request-mailer
Pull Request #1801: 1586 request mailer

10 of 10 new or added lines in 2 files covered. (100.0%)

1173 existing lines in 56 files now uncovered.

2482 of 2821 relevant lines covered (87.98%)

317.98 hits per line

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

100.0
/app/presenters/project_dashboard_presenter.rb
1
# frozen_string_literal: true
2
class ProjectDashboardPresenter < ProjectShowPresenter
2✔
3
  include ActionView::Helpers::DateHelper
2✔
4

5
  delegate :to_model, :updated_at, to: :project
2✔
6

7
  delegate :data_sponsor, :data_manager, to: :project_metadata
2✔
8

9
  def type
2✔
10
    if storage_performance_expectations["approved"].nil?
116✔
UNCOV
11
      "Requested #{storage_performance_expectations['requested']}"
5✔
12
    else
13
      storage_performance_expectations["approved"]
111✔
14
    end
15
  end
16

17
  def latest_file_list_time
2✔
18
    requests = FileInventoryRequest.where(project_id: project.id).order(completion_time: :desc)
117✔
19
    if requests.empty?
117✔
20
      "No Downloads"
113✔
21
    elsif requests.first.completion_time
4✔
22
      "Prepared #{time_ago_in_words(requests.first.completion_time)} ago"
3✔
23
    else
UNCOV
24
      "Preparing now"
1✔
25
    end
26
  end
27

28
  def last_activity
2✔
29
    if project_metadata.updated_on.nil?
115✔
UNCOV
30
      "Not yet active"
4✔
31
    else
32
      "#{remove_about time_ago_in_words(project_metadata.updated_on)} ago"
111✔
33
    end
34
  end
35

36
  def role(user)
2✔
37
    if data_sponsor == user.uid
114✔
38
      "Sponsor"
18✔
39
    elsif data_manager == user.uid
96✔
40
      "Data Manager"
12✔
41
    else
42
      "Data User"
84✔
43
    end
44
  end
45

46
  # Removes "about" (as in "about 1 month ago") from time_ago_in_words
47
  def remove_about(time_ago)
2✔
48
    time_ago.gsub("about ", "")
111✔
49
  end
50
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