aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRobert2017-07-28 17:52:17 +0200
committerRobert2017-08-01 22:12:33 +0200
commit7680c88adf7d5161908d630a51a83cde603e5f6d (patch)
tree6d0f771ba63ef8f3d57e110b4cdd46e785d3edad /spec
parentf4a879becb6ac5f3229f77e8a14122f085e02be5 (diff)
downloadchouette-core-7680c88adf7d5161908d630a51a83cde603e5f6d.tar.bz2
Refs: #4176@1h; Specing Referential Creation on NetexImport API call
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/v1/netex_import_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/requests/api/v1/netex_import_spec.rb b/spec/requests/api/v1/netex_import_spec.rb
index ab1e7f6ae..e92901d83 100644
--- a/spec/requests/api/v1/netex_import_spec.rb
+++ b/spec/requests/api/v1/netex_import_spec.rb
@@ -32,8 +32,9 @@ RSpec.describe "NetexImport", type: :request do
let( :authorization ){ authorization_token_header( get_api_key.token ) }
- it 'succeeds' do
- post_request.(netex_import: legal_attributes)
+ it 'succeeds', :wip do
+ legal_attributes # force object creation for correct to change behavior
+ expect{post_request.(netex_import: legal_attributes)}.to change{Referential.count}.by(1)
expect( response ).to be_success
expect( json_response_body ).to eq({'id' => NetexImport.last.id, 'type' => 'NetexImport'})
end
@@ -47,7 +48,8 @@ RSpec.describe "NetexImport", type: :request do
let( :authorization ){ authorization_token_header( "#{referential.id}-incorrect_token") }
it 'does not succeed' do
- post_request.(netex_import: legal_attributes)
+ legal_attributes # force object creation for correct to change behavior
+ expect{ post_request.(netex_import: legal_attributes) }.not_to change{Referential.count}
expect( response.status ).to eq(401)
end