mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 10:53:47 +08:00
15 lines
358 B
Ruby
15 lines
358 B
Ruby
require 'rails_helper'
|
|
|
|
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
|
|
end
|
|
|
|
it 'should return 0 by default' do
|
|
u = Fabricate(:user)
|
|
expect(DraftSequence.current(u, 'test')).to eq 0
|
|
end
|
|
end
|