diff options
| -rw-r--r-- | app/models/import.rb | 4 | ||||
| -rw-r--r-- | spec/models/import_spec.rb | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/import.rb b/app/models/import.rb index e5da74d94..d79d93e4a 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -61,9 +61,11 @@ class Import < ActiveRecord::Base status = self.status if children_failed_count > 0 status = 'failed' - # TODO: Update `ended_at` elsif status_count['successful'] == children_count status = 'successful' + end + + if self.class.finished_statuses.include?(status) attributes[:ended_at] = Time.now end diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb index 6d3d23830..54bd59e3e 100644 --- a/spec/models/import_spec.rb +++ b/spec/models/import_spec.rb @@ -152,5 +152,11 @@ RSpec.describe Import, :type => :model do end end + describe "#update_status" do + it "updates :ended_at to now when status is finished" do + pending "Redo the `#update_status` code to make it easier to write this." + end + end + # TODO: specs for #update_referential end |
