spec/server/user_spec.rb in cellect-server-0.0.7 vs spec/server/user_spec.rb in cellect-server-0.0.8

- old
+ new

@@ -3,30 +3,30 @@ module Cellect::Server describe User do let(:user){ User.new 1, workflow_name: 'random' } it 'should store seen ids' do - user.seen.should be_a DiffSet::RandomSet + expect(user.seen).to be_a DiffSet::RandomSet end it 'should have a default ttl of 15 minutes' do - user.ttl.should == 900 # seconds + expect(user.ttl).to eq 900 # seconds end it 'should allow custom ttl' do - User.new(2, workflow_name: 'random', ttl: 123).ttl.should == 123 + expect(User.new(2, workflow_name: 'random', ttl: 123).ttl).to eq 123 end it 'should reset the ttl timer on activity' do - user.bare_object.should_receive(:restart_ttl_timer).at_least :once + expect(user.bare_object).to receive(:restart_ttl_timer).at_least :once user.seen end it 'should terminate on ttl expiry' do async_workflow = double - Workflow[user.workflow_name].should_receive(:async).and_return async_workflow - async_workflow.should_receive(:remove_user).with user.id + expect(Workflow[user.workflow_name]).to receive(:async).and_return async_workflow + expect(async_workflow).to receive(:remove_user).with user.id user.ttl_expired! - user.ttl_timer.should be_nil + expect(user.ttl_timer).to be_nil end end end