diff options
| author | Zog | 2018-03-09 17:25:38 +0100 | 
|---|---|---|
| committer | Zog | 2018-03-12 12:00:15 +0100 | 
| commit | 3a738f4509a67d5024fb85bb551c7ec285cd031e (patch) | |
| tree | 3fd3f0cbfb133e07c66cd3795e81cdd74c648397 /spec/models/import | |
| parent | 0cd50ea684248e13391ef4f5ee5af5550ff6491f (diff) | |
| download | chouette-core-3a738f4509a67d5024fb85bb551c7ec285cd031e.tar.bz2 | |
Refs #6133; Fix specs
Diffstat (limited to 'spec/models/import')
| -rw-r--r-- | spec/models/import/import_spec.rb | 15 | 
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/models/import/import_spec.rb b/spec/models/import/import_spec.rb index cbc5907fa..6b9201129 100644 --- a/spec/models/import/import_spec.rb +++ b/spec/models/import/import_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Import::Base, type: :model do    include ActionDispatch::TestProcess    it { should allow_value(fixture_file_upload('OFFRE_TRANSDEV_2017030112251.zip')).for(:file) } -  it { should_not allow_value(fixture_file_upload('users.json')).for(:file).with_message(I18n.t('errors.messages.extension_whitelist_error', extension: '"json"', allowed_types: "zip")) } +  it { should_not allow_value(fixture_file_upload('reflex_updated.xml')).for(:file).with_message(I18n.t('errors.messages.extension_whitelist_error', extension: '"xml"', allowed_types: "zip, csv, json")) }    let(:workbench_import) {netex_import.parent}    let(:workbench_import_with_completed_steps) do @@ -24,7 +24,7 @@ RSpec.describe Import::Base, type: :model do    end    let(:netex_import) do -    build_stubbed( +    create(        :netex_import      )    end @@ -115,19 +115,18 @@ RSpec.describe Import::Base, type: :model do        allow(netex_import).to receive(:update)        expect(workbench_import).to receive(:child_change) - +      netex_import.status = :foo        netex_import.notify_parent      end      it "must update the :notified_parent_at field of the child import" do        allow(workbench_import).to receive(:child_change) - -      Timecop.freeze(DateTime.now) do -        expect(netex_import).to receive(:update).with( -          notified_parent_at: DateTime.now -        ) +      Timecop.freeze(Time.now) do +        netex_import.status = :bar          netex_import.notify_parent +        expect(netex_import.notified_parent_at).to eq Time.now +        expect(netex_import.reload.notified_parent_at).to eq Time.now        end      end    end  | 
