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

pulibrary / pdc_describe / 9dbcf7a4-1c56-4510-9614-74ad5a22cff6

31 Jul 2024 02:46PM UTC coverage: 1.08% (-95.1%) from 96.17%
9dbcf7a4-1c56-4510-9614-74ad5a22cff6

push

circleci

jrgriffiniii
wip

52 of 4814 relevant lines covered (1.08%)

0.01 hits per line

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

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

21
  private
×
22

23
    def run_migration(work)
×
24
      dspace = PULDspaceMigrate.new(work, current_user)
×
25
      dspace.migrate
×
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

© 2025 Coveralls, Inc