Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Mirri Kim
Hi Soichi, You can temporarily do `if @plan.save!` to raise an error instead of just having it return false and not give you any feedback. Doing this is okay because you should not bother testing your validations as far as the controller is concerned (you do that on your model). In any case, try t

Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Norbert Melzer
What he wants to say is that you should log or print the error-array of your model and look what exactly doesn't fit into your validations. Am 12.11.2012 11:13 schrieb "Soichi Ishida" : > > On your controller, use `create!` to see what is preventing the save. > > Sorry, I don't quite understand wh

[Rails] Re: RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
> On your controller, use `create!` to see what is preventing the save. Sorry, I don't quite understand what you mean. my plans_controller.rb has def create @plan = Plan.new(params[:plan]) respond_to do |format| if @plan.save format.html { redirect_to @plan, notice: 'Pla

[Rails] Re: RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
> Where do you define valid attributes? > You mean, def valid_attributes FactoryGirl.build(:plan).attributes end in plans_controller_spec.rb ? Even if so, I am not sure if it's a right way. soichi -- Posted via http://www.ruby-forum.com/. -- You received this message because yo