diff options
| author | Teddy Wing | 2017-08-30 18:26:17 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-08-30 18:26:17 +0200 | 
| commit | bd7b3374f87f083ffcb2c9d5d52ac2f3d2049e2b (patch) | |
| tree | 14e017ddda0cf52f861fdd1f28e386fca2c821ac /spec/models | |
| parent | 7220c54b4ec097bd5d7292cb0b7a068ddb726a7c (diff) | |
| download | chouette-core-bd7b3374f87f083ffcb2c9d5d52ac2f3d2049e2b.tar.bz2 | |
Import spec: Test that `ended_at` gets updated correctly
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/import_spec.rb | 13 | 
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb index 2a0c7539e..cc0fdd4ce 100644 --- a/spec/models/import_spec.rb +++ b/spec/models/import_spec.rb @@ -128,7 +128,18 @@ RSpec.describe Import, type: :model do      end      it "updates :ended_at to now when status is finished" do -      skip "Redo the `#update_status` code to make it easier to write this." +      workbench_import = create(:workbench_import) +      create( +        :netex_import, +        parent: workbench_import, +        status: 'failed' +      ) + +      Timecop.freeze(Time.now) do +        workbench_import.update_status + +        expect(workbench_import.ended_at).to eq(Time.now) +      end      end    end  | 
