aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests
diff options
context:
space:
mode:
authorAlban Peignier2017-08-27 23:50:35 +0200
committerAlban Peignier2017-08-27 23:50:35 +0200
commitd79f84398849e9c32fdf41582d299dd914fb8452 (patch)
treee03fee9d967d8d4435784c9650806c8cfa47ca78 /spec/requests
parent4a9923079ed9d1658f7c6321ceab1d7e5c086037 (diff)
downloadchouette-core-d79f84398849e9c32fdf41582d299dd914fb8452.tar.bz2
Create STIF::NetexFile to read zip content and create ReferentialMetadata from real data. Refs #4273
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/v1/netex_import_spec.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/requests/api/v1/netex_import_spec.rb b/spec/requests/api/v1/netex_import_spec.rb
index 70a41256e..06ff76e14 100644
--- a/spec/requests/api/v1/netex_import_spec.rb
+++ b/spec/requests/api/v1/netex_import_spec.rb
@@ -32,9 +32,8 @@ RSpec.describe "NetexImport", type: :request do
let( :authorization ){ authorization_token_header( get_api_key.token ) }
it 'succeeds' do
- # TODO: Handle better when `ReferentialMetadataKludge` is reworked
- create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00108')
- create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00109')
+ create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00108', line_referential: workbench.line_referential)
+ create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00109', line_referential: workbench.line_referential)
post_request.(netex_import: legal_attributes)
expect( response ).to be_success
@@ -46,16 +45,15 @@ RSpec.describe "NetexImport", type: :request do
end
it 'creates a NetexImport object in the DB' do
- # TODO: Handle better when `ReferentialMetadataKludge` is reworked
- create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00108')
- create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00109')
+ create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00108', line_referential: workbench.line_referential)
+ create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00109', line_referential: workbench.line_referential)
expect{ post_request.(netex_import: legal_attributes) }.to change{NetexImport.count}.by(1)
end
it 'creates a correct Referential' do
- create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00108')
- create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00109')
+ create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00108', line_referential: workbench.line_referential)
+ create(:line, objectid: 'STIF:CODIFLIGNE:Line:C00109', line_referential: workbench.line_referential)
legal_attributes # force object creation for correct to change behavior
expect{post_request.(netex_import: legal_attributes)}.to change{Referential.count}.by(1)