Created
July 13, 2012 14:44
-
-
Save svs/3105262 to your computer and use it in GitHub Desktop.
omg spec!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should move properly between states" do | |
@doc = Factory.build(:taggable, :user => @customer) | |
@doc.scan!(@customer) | |
@doc.scanned?.should == true | |
@doc.digi_document_state_transitions.count.should == 1 | |
expect { @doc.tag_complete!}.should raise_exception # should not 'complete' | |
@doc.completed?.should == false | |
@doc.to_edit!(@customer) # should 'edit' | |
@doc.editing?.should == true | |
@doc.digi_document_state_transitions.count.should == 2 | |
@doc.digi_document_state_transitions.last.event.should == "to_edit" | |
@doc.state.should == "editing" | |
@doc.tag_complete!(@tagger) | |
@doc.completed?.should == true # should 'complete' | |
@doc.state.should == "completed" | |
@doc = Factory.build(:taggable, :user => @customer) # new test | |
expect {@doc.tag_incomplete!(@customer)}.should raise_exception # should not tag_* | |
@doc.incomplete?.should == false | |
expect {@doc.checker_accept!}.should raise_exception # should not checker_accept | |
@doc.checker_accepted?.should == false | |
expect {@doc.checker_reject!}.should raise_exception | |
@doc = Factory.build(:taggable, :user => @customer) | |
@doc.scan!(@customer) # should scan | |
@doc.scanned?.should == true | |
expect {@doc.tag_illegible!(@customer)}.should raise_exception # should not tag_* | |
@doc.illegible?.should == false | |
@doc.to_edit!(@customer) # should edit | |
@doc.editing?.should == true | |
@doc.tag_illegible!(@customer) # should tag_* | |
@doc.illegible?.should == true | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment