aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorTeddy Wing2017-08-28 18:35:58 +0200
committerTeddy Wing2017-08-28 18:38:39 +0200
commit1fe97b3bb1429916f7dde8e90dde49197135398b (patch)
tree6cf6c5fe7549ba6eaa409547059ab5c8d513401b /spec
parente38390a4c1fb87041db0e699c70c9a15cad02bb8 (diff)
downloadchouette-core-1fe97b3bb1429916f7dde8e90dde49197135398b.tar.bz2
Import spec: Ensure `#update_` methods are called on `#child_change`
Some quick tests for the recent changes to `#child_change`, to ensure that `#update_status` and `#update_referential` are called by the method.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/import_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb
index 76f945871..3300392b7 100644
--- a/spec/models/import_spec.rb
+++ b/spec/models/import_spec.rb
@@ -132,6 +132,20 @@ RSpec.describe Import, :type => :model do
"doesn't update :status if parent import status is finished",
"canceled"
)
+
+ it "calls #update_status" do
+ allow(workbench_import).to receive(:update)
+
+ expect(workbench_import).to receive(:update_status)
+ workbench_import.child_change
+ end
+
+ it "calls #update_referential" do
+ allow(workbench_import).to receive(:update)
+
+ expect(workbench_import).to receive(:update_referential)
+ workbench_import.child_change
+ end
end
describe "#ready?" do