spec/server/api/remove_spec.rb in cellect-server-0.0.1 vs spec/server/api/remove_spec.rb in cellect-server-0.0.2

- old
+ new

@@ -5,28 +5,28 @@ 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(:project_type){ [grouping, set_type].compact.join '_' } - let(:project){ Project[project_type] } - let(:user){ project.user 123 } - before(:each){ pass_until project, is: :ready } + 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 project.grouped? + h[:group_id] = 1 if workflow.grouped? end end it 'should remove subjects' do - if project.grouped? - project.should_receive(:remove).with subject_id: 123, group_id: 1, priority: nil + if workflow.grouped? + workflow.should_receive(:remove).with subject_id: 123, group_id: 1, priority: nil else - project.should_receive(:remove).with subject_id: 123, group_id: nil, priority: nil + workflow.should_receive(:remove).with subject_id: 123, group_id: nil, priority: nil end - put "/projects/#{ project_type }/remove", opts + put "/workflows/#{ workflow_type }/remove", opts last_response.status.should == 200 end end end end