mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Add spec for initialization of state on before_create. Closes #91.
This commit is contained in:
parent
65315189a1
commit
7ce3032968
1 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,11 @@ describe "instance methods" do
|
|||
gate.valid?
|
||||
end
|
||||
|
||||
it "should call aasm_ensure_initial_state before create, even if skipping validations" do
|
||||
gate.should_receive(:aasm_ensure_initial_state).and_return(true)
|
||||
gate.save(validate: false)
|
||||
end
|
||||
|
||||
it "should not call aasm_ensure_initial_state on validation before update" do
|
||||
gate.stub(:new_record?).and_return(false)
|
||||
gate.should_not_receive(:aasm_ensure_initial_state)
|
||||
|
|
Loading…
Reference in a new issue