spec/server/api/remove_spec.rb in cellect-server-1.3.2 vs spec/server/api/remove_spec.rb in cellect-server-1.3.3

- old
+ new

@@ -26,9 +26,28 @@ end put "/workflows/#{ workflow_type }/remove", opts expect(last_response.status).to eq 200 end + + it 'should handle invalid subject_ids' do + bad_opts = opts.merge subject_id: '%(*ERRRR)' + put "/workflows/#{ workflow_type }/remove", bad_opts + expect(last_response.status).to eql 400 + expect(last_response.body).to match /Bad Request/ + end + + it 'should handle invalid group_ids' do + if workflow.grouped? + bad_opts = opts.merge group_id: '%(*ERRRR)' + put "/workflows/#{ workflow_type }/remove", bad_opts + expect(last_response.status).to eql 400 + expect(last_response.body).to match /Bad Request/ + else + put "/workflows/#{ workflow_type }/remove", opts + expect(last_response).to be_ok + end + end end end end it 'should handle missing workflows' do