From e793bffd18b331f2db2bb567c479fdbf02c66aec Mon Sep 17 00:00:00 2001 From: Xinhui Date: Tue, 22 Aug 2017 16:01:56 +0200 Subject: API - workbench imports controller --- spec/controllers/api/v1/imports_controller_spec.rb | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/controllers/api/v1/imports_controller_spec.rb (limited to 'spec/controllers/api') diff --git a/spec/controllers/api/v1/imports_controller_spec.rb b/spec/controllers/api/v1/imports_controller_spec.rb new file mode 100644 index 000000000..52fbf8e9b --- /dev/null +++ b/spec/controllers/api/v1/imports_controller_spec.rb @@ -0,0 +1,25 @@ +require 'rails_helper' + +RSpec.describe Api::V1::ImportsController, type: :controller do + let(:workbench) { create :workbench, organisation: organisation } + + context 'unauthenticated' do + describe 'GET #index' do + it 'should not be successful' do + get :index, workbench_id: workbench.id + 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, workbench_id: workbench.id + expect(response).to be_success + end + end + end +end -- cgit v1.2.3