spec/server/api/sample_spec.rb in cellect-server-0.0.7 vs spec/server/api/sample_spec.rb in cellect-server-0.0.8
- old
+ new
@@ -11,22 +11,22 @@
let(:workflow){ Workflow[workflow_type] }
let(:user){ workflow.user 123 }
before(:each){ pass_until workflow, is: :ready }
it 'should sample without a user, limit, or group' do
- workflow.should_receive(:sample).with(limit: 5, user_id: nil, group_id: nil).and_call_original
+ expect(workflow).to receive(:sample).with(limit: 5, user_id: nil, group_id: nil).and_call_original
get "/workflows/#{ workflow_type }"
- last_response.status.should == 200
- json.should be_a Array
+ expect(last_response.status).to eq 200
+ expect(json).to be_a Array
end
shoulda = grouping ? 'limit, group, and user' : 'limit and user'
it "should sample with a #{ shoulda }" do
group_id = grouping ? 1 : nil
- workflow.should_receive(:sample).with(limit: 3, user_id: 123, group_id: group_id).and_call_original
+ expect(workflow).to receive(:sample).with(limit: 3, user_id: 123, group_id: group_id).and_call_original
get "/workflows/#{ workflow_type }?limit=3&user_id=123#{ grouping ? '&group_id=1' : '' }"
- last_response.status.should == 200
- json.should be_a Array
+ expect(last_response.status).to eq 200
+ expect(json).to be_a Array
end
end
end
end
end