On 05/19/11 - 10:22:07AM, Matt Wagner wrote:
---
src/spec/controllers/instance_controller_spec.rb | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/spec/controllers/instance_controller_spec.rb
b/src/spec/controllers/instance_controller_spec.rb
index 2971013..ee968cb 100644
--- a/src/spec/controllers/instance_controller_spec.rb
+++ b/src/spec/controllers/instance_controller_spec.rb
@@ -139,9 +139,12 @@ describe InstancesController do
:hardware_profile_id => hwp.id }
end.should change(Instance, :count).by(1)
instance = Instance.find_by_name('mockinstance5')
+ instance.state.should_not == "running"
+ # The image is supposed to be 'new' but may be 'create_failed'; it
doesn't matter here
I wouldn't put this particular comment in. As long as we stick with the
current matching scheme, this will always be "create_failed". I would just
put something like:
# the state of the instance doesn't matter here, as long as it is the same
# before and after the put
+ old_state = instance.state
put :update, :instance => {:state => 'running', :name =>
'mockinstance6'}, :id => instance.id
instance.reload
- instance.state.should == "new"
+ instance.state.should == old_state
instance.name.should == "mockinstance6"
end
end
The code itself looks reasonable enough to me.
--
Chris Lalancette