discourse/spec/models/draft_sequence_spec.rb

15 lines
358 B
Ruby
Raw Normal View History

require 'rails_helper'
2013-02-06 03:16:51 +08:00
describe DraftSequence do
it 'should produce next sequence for a key' do
u = Fabricate(:user)
expect(DraftSequence.next!(u, 'test')).to eq 1
expect(DraftSequence.next!(u, 'test')).to eq 2
2013-02-06 03:16:51 +08:00
end
2013-02-26 00:42:20 +08:00
it 'should return 0 by default' do
2013-02-06 03:16:51 +08:00
u = Fabricate(:user)
expect(DraftSequence.current(u, 'test')).to eq 0
2013-02-06 03:16:51 +08:00
end
end