2015-10-11 05:41:23 -04:00
|
|
|
require 'rails_helper'
|
2013-02-05 14:16:51 -05:00
|
|
|
|
|
|
|
describe DraftSequence do
|
|
|
|
it 'should produce next sequence for a key' do
|
|
|
|
u = Fabricate(:user)
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(DraftSequence.next!(u, 'test')).to eq 1
|
|
|
|
expect(DraftSequence.next!(u, 'test')).to eq 2
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
2013-02-25 11:42:20 -05:00
|
|
|
it 'should return 0 by default' do
|
2013-02-05 14:16:51 -05:00
|
|
|
u = Fabricate(:user)
|
2014-12-31 09:55:03 -05:00
|
|
|
expect(DraftSequence.current(u, 'test')).to eq 0
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
end
|