diff options
| author | Xinhui | 2017-08-22 14:30:19 +0200 |
|---|---|---|
| committer | Xinhui | 2017-08-22 14:52:49 +0200 |
| commit | e44b43ba2d6aeab84a2aead6e01aa9cd71c2d6e5 (patch) | |
| tree | af22e3c373f8b3c9f37bfaeea937146e43abfb16 /spec/controllers/api | |
| parent | 9a281154ea20a6450bb53880f1dd77d5139075f1 (diff) | |
| download | chouette-core-e44b43ba2d6aeab84a2aead6e01aa9cd71c2d6e5.tar.bz2 | |
API - Rspec basic auth api controller
Diffstat (limited to 'spec/controllers/api')
| -rw-r--r-- | spec/controllers/api/v1/workbenches_controller_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/workbenches_controller_spec.rb b/spec/controllers/api/v1/workbenches_controller_spec.rb index 187d8ffeb..dc05c3926 100644 --- a/spec/controllers/api/v1/workbenches_controller_spec.rb +++ b/spec/controllers/api/v1/workbenches_controller_spec.rb @@ -1,5 +1,23 @@ require 'rails_helper' RSpec.describe Api::V1::WorkbenchesController, type: :controller do + context 'unauthenticated' do + describe 'GET #index' do + it 'should not be successful' do + get :index + expect(response).not_to be_success + end + end + end + context 'authenticated' do + include_context 'iboo authenticated api user' + + describe 'GET #index' do + it 'should be successful' do + get :index + expect(response).to be_success + end + end + end end |
