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

pulibrary / pdc_describe / 7ae96b6b-0a64-4479-9fa1-8ba6526e2c87

20 Mar 2024 12:42PM UTC coverage: 30.068% (-66.2%) from 96.266%
7ae96b6b-0a64-4479-9fa1-8ba6526e2c87

Pull #1701

circleci

leefaisonr
makes it so that links open in new window
Pull Request #1701: Update language on submission form

1019 of 3389 relevant lines covered (30.07%)

0.4 hits per line

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

48.15
/app/decorators/work_decorator.rb
1
# frozen_string_literal: true
2
class WorkDecorator
1✔
3
  include Rails.application.routes.url_helpers
1✔
4

5
  attr_reader :work, :changes, :messages, :can_curate, :current_user
1✔
6

7
  delegate :group, :resource, :draft?, to: :work
1✔
8
  delegate :migrated, to: :resource
1✔
9

10
  def initialize(work, current_user)
1✔
11
    @work = work
×
12
    @current_user = current_user
×
13
    @changes =  WorkActivity.changes_for_work(work.id)
×
14
    @messages = WorkActivity.messages_for_work(work.id).order(created_at: :desc)
×
15
    @can_curate = current_user&.can_admin?(group)
×
16
  end
17

18
  def current_user_is_admin?
1✔
19
    current_user.has_role?(:group_admin, group)
×
20
  end
21

22
  def show_approve_button?
1✔
23
    work.awaiting_approval? && current_user_is_admin?
×
24
  end
25

26
  def show_complete_button?
1✔
27
    draft? && (work.created_by_user_id == current_user.id || current_user_is_admin?)
×
28
  end
29

30
  def show_migrate_button?
1✔
31
    draft? && migrated && current_user_is_admin?
×
32
  end
33

34
  def wizard_mode?
1✔
35
    draft? && !migrated
×
36
  end
37

38
  def file_list_path
1✔
39
    return work_file_list_path("NONE") if @work.nil? || !@work.persisted?
×
40

41
    work_file_list_path(@work.id)
×
42
  end
43

44
  def download_path
1✔
45
    return if @work.nil? || !@work.persisted?
×
46

47
    work_download_path(@work.id)
×
48
  end
49
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