spec/server/workflow_spec.rb in cellect-server-0.1.0 vs spec/server/workflow_spec.rb in cellect-server-0.1.1
- old
+ new
@@ -1,9 +1,14 @@
require 'spec_helper'
module Cellect::Server
describe Workflow do
+ it "should try to load workflows that aren't loaded" do
+ expect(Cellect::Server.adapter).to receive(:load_workflows).with('random').and_call_original
+ Workflow['random']
+ end
+
SET_TYPES.each do |workflow_type|
context workflow_type do
it_behaves_like 'workflow', :workflow
let(:workflow){ Workflow[workflow_type] }
let(:user){ workflow.user 123 }
@@ -33,11 +38,11 @@
workflow.add subject_id: 123
end
end
it 'should remove subjects' do
- expect(workflow.subjects).to receive(:add).with 123
- workflow.add subject_id: 123
+ expect(workflow.subjects).to receive(:remove).with 123
+ workflow.remove subject_id: 123
end
it 'should be notified of a user ttl expiry' do
async_workflow = double
expect(workflow).to receive(:async).and_return async_workflow