Sha256: 2e296949647c2b10a0fd7e863d78feb43001d65b84c719f77d8fac20d05da4eb
Contents?: true
Size: 1.13 KB
Versions: 6
Compression:
Stored size: 1.13 KB
Contents
require 'spec_helper' module Cellect::Server describe API do include_context 'API' { 'Ungrouped' => nil, 'Grouped' => 'grouped' }.each_pair do |grouping_type, grouping| SET_TYPES.shuffle.each do |set_type| context "#{ grouping_type } #{ set_type }" do let(:workflow_type){ [grouping, set_type].compact.join '_' } let(:workflow){ Workflow[workflow_type] } let(:user){ workflow.user 123 } before(:each){ pass_until workflow, is: :ready } let(:opts) do { subject_id: 123 }.tap do |h| h[:group_id] = 1 if workflow.grouped? end end it 'should remove subjects' do if workflow.grouped? workflow.should_receive(:remove).with subject_id: 123, group_id: 1, priority: nil else workflow.should_receive(:remove).with subject_id: 123, group_id: nil, priority: nil end put "/workflows/#{ workflow_type }/remove", opts last_response.status.should == 200 end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems