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

pulibrary / pdc_describe / 35525209-8c8b-426d-b992-849111d800ff

02 Jun 2026 07:47PM UTC coverage: 41.528% (-54.0%) from 95.52%
35525209-8c8b-426d-b992-849111d800ff

Pull #2324

circleci

carolyncole
Updating code to allow for multiple WorkActivity classes based on the transition
Pull Request #2324: Updating code to allow for multiple WorkActivity classes based on the…

35 of 87 new or added lines in 6 files covered. (40.23%)

2096 existing lines in 79 files now uncovered.

1647 of 3966 relevant lines covered (41.53%)

4.81 hits per line

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

25.0
/app/controllers/work_migration_controller.rb
1
# frozen_string_literal: true
2
class WorkMigrationController < ApplicationController
1✔
3
  # @note No testing coverage for RuntimeError but depends on Dspaces
4
  def migrate
1✔
UNCOV
5
    work = Work.find(params[:id])
×
UNCOV
6
    if work.ark.present? && current_user.can_admin?(work.group)
×
7
      begin
UNCOV
8
        run_migration(work)
×
9
      rescue RuntimeError => e
10
        flash[:notice] = e.message
×
11
      end
UNCOV
12
    elsif !current_user.can_admin?(work.group)
×
UNCOV
13
      flash[:notice] = "Unauthorized migration"
×
UNCOV
14
      Honeybadger.notify("Unauthorized to migration work #{work.id} (current user: #{current_user.id})")
×
15
    else
UNCOV
16
      flash[:notice] = "The ark is blank, no migration from Dataspace is possible"
×
17
    end
UNCOV
18
    redirect_to work_path(work)
×
19
  end
20

21
  private
1✔
22

23
    def run_migration(work)
1✔
UNCOV
24
      dspace = PULDspaceMigrate.new(work, current_user)
×
UNCOV
25
      dspace.migrate
×
UNCOV
26
      flash[:notice] = dspace.migration_message
×
27
    end
28
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

© 2026 Coveralls, Inc