discourse/spec/models/draft_sequence_spec.rb

15 lines
345 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
require 'spec_helper'
describe DraftSequence do
it 'should produce next sequence for a key' do
u = Fabricate(:user)
DraftSequence.next!(u, 'test').should == 1
DraftSequence.next!(u, 'test').should == 2
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)
DraftSequence.current(u, 'test').should == 0
end
end