diff options
| author | Teddy Wing | 2017-08-01 19:28:55 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-08-01 19:30:23 +0200 | 
| commit | 240c2270ca8e21c75170d6b7764562c049ef661a (patch) | |
| tree | ae471688195b76f7791f322f8d72fe593dbcd969 /spec/models/import_spec.rb | |
| parent | aee3eb9f6533e88c817ffde7299b1d22544a8077 (diff) | |
| download | chouette-core-240c2270ca8e21c75170d6b7764562c049ef661a.tar.bz2 | |
Import#notify_parent: Call #child_change on parent import
Calling `#notify_parent` should call the `#child_change` method on the
import's parent import. That `#child_change` method will tell the parent
to update itself based on the status of the child.
Refs #3511
Diffstat (limited to 'spec/models/import_spec.rb')
| -rw-r--r-- | spec/models/import_spec.rb | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb index 88d339ea0..53513eb0c 100644 --- a/spec/models/import_spec.rb +++ b/spec/models/import_spec.rb @@ -9,4 +9,18 @@ RSpec.describe Import, :type => :model do    it { should validate_presence_of(:file) }    it { should validate_presence_of(:referential) }    it { should validate_presence_of(:workbench) } + +  describe "#notify_parent" do +    it "must call #child_change on its parent" do +      workbench_import = build_stubbed(:workbench_import) +      netex_import = build_stubbed( +        :netex_import, +        parent: workbench_import +      ) + +      expect(workbench_import).to receive(:child_change).with(netex_import) + +      netex_import.notify_parent +    end +  end  end | 
