diff options
| author | Teddy Wing | 2017-08-01 21:15:36 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-08-01 21:15:36 +0200 | 
| commit | c0aff43cbd6f4b5c4d131e577b3ad91679883d63 (patch) | |
| tree | ff4ef751ba8bad8c5001db79ae34ec27705afee5 | |
| parent | 327975ede5e0c400887152fd0f8112a40aafa005 (diff) | |
| download | chouette-core-c0aff43cbd6f4b5c4d131e577b3ad91679883d63.tar.bz2 | |
Import spec: Move helper method into `it` block
Not sure if this could cause any problems, but it makes more sense to me
to put the helper method in the test where it's used, since that's the
only place where it's used and that test is the only reason why it
exists.
Refs #3509, #3511
| -rw-r--r-- | spec/models/import_spec.rb | 28 | 
1 files changed, 14 insertions, 14 deletions
| diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb index 408319897..d99376a90 100644 --- a/spec/models/import_spec.rb +++ b/spec/models/import_spec.rb @@ -25,24 +25,24 @@ RSpec.describe Import, :type => :model do    end    describe "#child_change" do -    def updates_status_to_failed_when_child_status_indicates_failure( -      failure_status -    ) -      workbench_import = build_stubbed(:workbench_import) -      allow(workbench_import).to receive(:update) - -      netex_import = build_stubbed( -        :netex_import, -        parent: workbench_import, -        status: failure_status +    it "updates :status to failed when child status indicates failure" do +      def updates_status_to_failed_when_child_status_indicates_failure( +        failure_status        ) +        workbench_import = build_stubbed(:workbench_import) +        allow(workbench_import).to receive(:update) -      expect(workbench_import).to receive(:update).with(status: 'failed') +        netex_import = build_stubbed( +          :netex_import, +          parent: workbench_import, +          status: failure_status +        ) -      workbench_import.child_change(netex_import) -    end +        expect(workbench_import).to receive(:update).with(status: 'failed') + +        workbench_import.child_change(netex_import) +      end -    it "updates :status to failed when child status indicates failure" do        updates_status_to_failed_when_child_status_indicates_failure('failed')        updates_status_to_failed_when_child_status_indicates_failure('aborted')        updates_status_to_failed_when_child_status_indicates_failure('canceled') | 
