aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/import_spec.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-08-30 11:30:35 +0200
committerTeddy Wing2017-08-30 11:30:35 +0200
commit1f13f38190fe219220f6093204e79f6a13c3d1fc (patch)
tree1fa2b45acaa8a41583094a46815861b9635ea03d /spec/models/import_spec.rb
parent36c65586265bee358b37e824acde91adc7a61a34 (diff)
downloadchouette-core-1f13f38190fe219220f6093204e79f6a13c3d1fc.tar.bz2
Import spec: Get a few old specs to pass
Update the mock to include the `ended_at` field update that happens in the code to get these tests green again. Not sure if we're going to continue to use them in their current state, but we'll worry about that later.
Diffstat (limited to 'spec/models/import_spec.rb')
-rw-r--r--spec/models/import_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb
index 0aee62ec1..7069cd066 100644
--- a/spec/models/import_spec.rb
+++ b/spec/models/import_spec.rb
@@ -49,7 +49,7 @@ RSpec.describe Import, type: :model do
end
# TODO: Move most of these to #update_status
- describe "#child_change", skip: "THE CODE CHANGED AND THESE SPECS NO LONGER WORK. FIX THEM ASAP!!!~!~!@~" do
+ describe "#child_change" do
shared_examples(
"updates :status to failed when child status indicates failure"
) do |failure_status|
@@ -61,12 +61,15 @@ RSpec.describe Import, type: :model do
status: failure_status
)
- expect(workbench_import).to receive(:update).with(
- current_step: 1,
- status: 'failed'
- )
+ Timecop.freeze(Time.now) do
+ expect(workbench_import).to receive(:update).with(
+ current_step: 1,
+ ended_at: Time.now,
+ status: 'failed'
+ )
- workbench_import.child_change
+ workbench_import.child_change
+ end
end
end