Skip to content

Instantly share code, notes, and snippets.

@mikeweber
Created March 21, 2012 15:14
Show Gist options
  • Save mikeweber/2148233 to your computer and use it in GitHub Desktop.
Save mikeweber/2148233 to your computer and use it in GitHub Desktop.
state testing
let(:state1) {
FactoryGirl.build(:workflow)
}
let(:state2) {
state1.run_step1
state1
}
let(:state3) {
state2.run_step2
state2
}
context "when in state 1" do
subject { state1 }
it { should be_in_state1 }
end
context "when in state 2" do
subject { state2 }
it { should be_in_state2 }
end
context "when in state 3" do
subject { state3 }
it { should be_in_state3 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment