Displaying 2 results from an estimated 2 matches for "valid_param".
Did you mean:
valid_params
2007 Oct 26
5
specing rescue, ensure and else blocks of an Exception
...block
ensure
...ensure block
end
I have a specs for this, like this one:
it "should retrieve a Foo instance, identified by ID and update it''s
parameters" do
Foo.should_receive(:find).with("1").and_return(@foo)
@foo.should_receive(:update_attributes!).with
(valid_params).and_return(@foo)
get :action, :id => 1
response.should be_redirect
end
it "should retrieve a Foo instance, identified by ID and throw an
exception, because of bad parameters" do
Foo.should_receive(:find).with("1").and_return(@foo)
@foo.should_receive(:update_...
2007 Nov 07
5
Unexplainable failure...at least for me
...rs/chris/Documents/Projects/Rails/MyProject/trunk/config/../app/models/address.rb:25:in
`full_address''
./spec/models/address_spec.rb:66:
script/spec:4:
Here is one of the tests that fail:
describe Address, "additional properties" do
before(:each) do
@address = Address.new(valid_params)
end
def valid_params
{
:country_id => 1,
:province_id => 1,
:region_code => "T5Z3J4",
:address_1 => "13245-56 st",
:address_2 => "NW",
:city => "Edmonton"
}
end
it "should return t...