> You can temporarily do `if @plan.save!` to raise an error instead of
> just
> having it return false and not give you any feedback.
the same result including
describe "with invalid params" do
...
part failures.
Doing this is okay
> In any case, try to
> validate your factory first (if you plan to use
> `FactoryGirl.attributes_for`) to prevent problems such as this.
I tried
def valid_attributes
{
:weight => 4,
:flight_name_id => 55,
:give_take => 0,
:day_departure => "2012-12-22",
:check_in => true
}
end
In other words, running the test without FactoryGirl. But it returns
13) PlansController POST create with valid params creates a new Plan
Failure/Error: post :create, {:plan => valid_attributes},
valid_session
ActiveRecord::RecordInvalid:
Validation failed: Give take can't be blank, Flight name can't be
blank, Day departure can't be blank, Weight can't be blank
So it looks like attributes are passed properly at all.
I am completely lost here...
soichi
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.