Displaying 1 result from an estimated 1 matches for "mock_herd_r".
Did you mean:
mock_herd
2011 Jul 11
2
Can't get this Rspec test to pass
...Herd.new
@persist_herd.operation_id = 1;
@persist_herd.herd_name = ''Persisted Herd
(herd_rations_controller_spec)''
@persist_herd.save!
end
describe "GET new" do
it "assigns a new herd_ration as @herd_ration" do
HerdRation.stub(:new){ mock_herd_ration }
Herd.stub(:find).with(1) { @persistant_herd }
get :new, :herd_id => 1
assigns(:herd_ration).should be(mock_herd_ration)
response.should be_success
end
end
and here''s my controller method:
def new
@herd_ration = HerdRation.new
@her...