aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/api/v1
diff options
context:
space:
mode:
authorXinhui2017-08-22 16:01:56 +0200
committerXinhui2017-08-22 16:01:56 +0200
commite793bffd18b331f2db2bb567c479fdbf02c66aec (patch)
tree7cb066eab3db23e68659fa365b42180a5becd2b0 /spec/controllers/api/v1
parent2df1767902996d43b56aa215bea15a033237b3ec (diff)
downloadchouette-core-e793bffd18b331f2db2bb567c479fdbf02c66aec.tar.bz2
API - workbench imports controller
Diffstat (limited to 'spec/controllers/api/v1')
-rw-r--r--spec/controllers/api/v1/imports_controller_spec.rb25
1 files changed, 25 insertions, 0 deletions
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