Skip to content

Commit

Permalink
a little bit of cleanup for the specs
Browse files Browse the repository at this point in the history
  • Loading branch information
alto committed Dec 13, 2012
1 parent 9244ea0 commit 2ed43c3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions spec/unit/persistence/active_record_persistence_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'rubygems'
require 'active_record'
require 'logger'
require 'spec_helper'
Expand Down Expand Up @@ -58,7 +57,7 @@
describe "instance methods" do
let(:gate) {Gate.new}

it "should respond to aasm states" do
it "should respond to aasm persistence methods" do
gate.should respond_to(:aasm_read_state)
gate.should respond_to(:aasm_write_state)
gate.should respond_to(:aasm_write_state_without_persistence)
Expand All @@ -85,16 +84,12 @@
gate.aasm_current_state.should be_nil
end

it "should have aasm_ensure_initial_state" do
gate.send :aasm_ensure_initial_state
end

it "should call aasm_ensure_initial_state on validation before create" do
gate.should_receive(:aasm_ensure_initial_state).and_return(true)
gate.valid?
end

it "should call aasm_ensure_initial_state on validation before create" do
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)
gate.valid?
Expand Down

0 comments on commit 2ed43c3

Please sign in to comment.