diff options
| author | Zog | 2018-03-08 11:46:20 +0100 |
|---|---|---|
| committer | Zog | 2018-03-12 12:00:14 +0100 |
| commit | a4a075f5eec935dd6a0dbf0a861b6ada13b1dcbc (patch) | |
| tree | b046d69937ce998d918a7a4bf5a3e2e418961fa1 /spec/models/export | |
| parent | db15dc6158939d2577ccd53aac66a283ce4f3338 (diff) | |
| download | chouette-core-a4a075f5eec935dd6a0dbf0a861b6ada13b1dcbc.tar.bz2 | |
Refs #6133; Add options on the Exports, and forward them tu the UX
Diffstat (limited to 'spec/models/export')
| -rw-r--r-- | spec/models/export/netex_export_spec.rb | 19 | ||||
| -rw-r--r-- | spec/models/export/workbench_export_spec.rb | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/spec/models/export/netex_export_spec.rb b/spec/models/export/netex_export_spec.rb new file mode 100644 index 000000000..d9cccd6ad --- /dev/null +++ b/spec/models/export/netex_export_spec.rb @@ -0,0 +1,19 @@ +RSpec.describe Export::Netex, type: [:model, :with_commit] do + + let( :boiv_iev_uri ){ URI("#{Rails.configuration.iev_url}/boiv_iev/referentials/exporter/new?id=#{subject.id}")} + + before do + allow(Thread).to receive(:new).and_yield + end + + context 'with referential' do + subject{ build( :netex_export, id: random_int ) } + + it 'will trigger the Java API' do + with_stubbed_request(:get, boiv_iev_uri) do |request| + with_commit{ subject.save! } + expect(request).to have_been_requested + end + end + end +end diff --git a/spec/models/export/workbench_export_spec.rb b/spec/models/export/workbench_export_spec.rb new file mode 100644 index 000000000..1b2e81aa4 --- /dev/null +++ b/spec/models/export/workbench_export_spec.rb @@ -0,0 +1,10 @@ +RSpec.describe Export::Workbench, type: [:model, :with_commit] do + it { should validate_presence_of(:timelapse) } + + it "should set options" do + expect(Export::Workbench.options).to have_key :timelapse + expect(Export::Workbench.options[:timelapse][:required]).to be_truthy + expect(Export::Workbench.options[:timelapse][:default_value]).to eq 90 + expect(Export::Workbench.options[:timelapse][:type]).to eq :integer + end +end |
