diff options
| author | Robert | 2017-07-28 17:52:17 +0200 |
|---|---|---|
| committer | Robert | 2017-07-28 17:52:17 +0200 |
| commit | 85c0c8ee82b5d7311e877c0eb88a961940cbecce (patch) | |
| tree | 8d0b93ca46183ed684dac8c1120ee96ac5f8c65d | |
| parent | aa5028a21f28a2bee9f64b5e87e70828c9c8b75f (diff) | |
| download | chouette-core-85c0c8ee82b5d7311e877c0eb88a961940cbecce.tar.bz2 | |
Refs: #4176@1h; Specing Referential Creation on NetexImport API call
| -rw-r--r-- | spec/requests/api/v1/netex_import_spec.rb | 8 |
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 1c34d5544..c0b1aafcb 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 |
