aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuc Donnet2017-12-08 07:26:33 +0100
committerLuc Donnet2017-12-08 07:26:33 +0100
commitaa5d50a20bbd07a3b526a20e24474629544a1dbc (patch)
tree9e46039a2c81d148d0b01847cb77cd8ef8d455df /spec
parent597b8eb21fe64babeb4a3ea03b1367c371237d98 (diff)
parent8680f61e8bd0a9cde4b3fa5d438fc86476daae56 (diff)
downloadchouette-core-aa5d50a20bbd07a3b526a20e24474629544a1dbc.tar.bz2
Merge branch 'master' into staging
Diffstat (limited to 'spec')
-rw-r--r--spec/models/import_spec.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb
index 4e8aac3f4..3e4128865 100644
--- a/spec/models/import_spec.rb
+++ b/spec/models/import_spec.rb
@@ -128,7 +128,7 @@ RSpec.describe Import, type: :model do
it "updates :status to successful when all children are successful" do
workbench_import = create(:workbench_import)
- create_list(
+ imports = create_list(
:netex_import,
2,
parent: workbench_import,
@@ -140,7 +140,7 @@ RSpec.describe Import, type: :model do
expect(workbench_import.status).to eq('successful')
end
- it "Updates :status to failed when any child has failed" do
+ it "updates :status to failed when any child has failed" do
workbench_import = create(:workbench_import)
[
'failed',
@@ -158,6 +158,24 @@ RSpec.describe Import, type: :model do
expect(workbench_import.status).to eq('failed')
end
+ it "updates :status to warning when any child has warning or successful" do
+ workbench_import = create(:workbench_import)
+ [
+ 'warning',
+ 'successful'
+ ].each do |status|
+ create(
+ :netex_import,
+ parent: workbench_import,
+ status: status
+ )
+ end
+
+ workbench_import.update_status
+
+ expect(workbench_import.status).to eq('warning')
+ end
+
it "updates :ended_at to now when status is finished" do
workbench_import = create(:workbench_import)
create(