diff options
| author | Vlatka Pavisic | 2017-02-28 16:03:59 +0100 |
|---|---|---|
| committer | Vlatka Pavisic | 2017-02-28 16:04:12 +0100 |
| commit | de028f8161d7175f02b9fa4861d9450942b5fd24 (patch) | |
| tree | f7d0fd2d40ee9eeb3a108512fbbc1c78b8ad6f27 /spec | |
| parent | 072e4f76f1c98dca9b4a85efa87052842d880d07 (diff) | |
| download | chouette-core-de028f8161d7175f02b9fa4861d9450942b5fd24.tar.bz2 | |
Refs #2670 : Update Import model
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/factories/imports.rb | 6 | ||||
| -rw-r--r-- | spec/models/import_spec.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/spec/factories/imports.rb b/spec/factories/imports.rb index bb9a97c9c..fc8668606 100644 --- a/spec/factories/imports.rb +++ b/spec/factories/imports.rb @@ -1,11 +1,13 @@ FactoryGirl.define do factory :import do - name "MyString" + sequence(:name) { |n| "Import #{n}" } current_step_id "MyString" current_step_progress 1.5 association :workbench association :referential file {File.open(File.join(Rails.root, 'spec', 'fixtures', 'terminated_job.json'))} - status "MyString" + status :new + started_at nil + ended_at nil end end diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb index 4c44eb99c..e34f368ae 100644 --- a/spec/models/import_spec.rb +++ b/spec/models/import_spec.rb @@ -4,5 +4,7 @@ RSpec.describe Import, :type => :model do it { should belong_to(:referential) } it { should belong_to(:workbench) } + it { should enumerize(:status).in(:new, :pending, :successful, :failed, :canceled) } + it { should validate_presence_of(:file) } end |
