Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-10 Thread Eivind Uggedal
I asked exactly this question on this list 2 days ago... See http://pastie.caboo.se/85887 for a working example. One has to mock out ActiveRecord::Errors::full_messages for it to work under Rails. Cheers, Eivind Uggedal On 8/9/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/8/07, Fischer,

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread Fischer, Daniel
It's redirecting to /users/1 so it's not causing a fail on the exception, which I don't know why. My question is how to properly do this in rSpec? On 8/8/07, Lance Carlson [EMAIL PROTECTED] wrote: Does it redirect instead? On 8/8/07, Fischer, Daniel [EMAIL PROTECTED] wrote: 1 def create

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread David Chelimsky
On 8/8/07, Fischer, Daniel [EMAIL PROTECTED] wrote: 1 def create 2 @user = User.new(params[:user]) 3 @user.save! 4 self.current_user = @user 5 redirect_to user_path(@user) 6 flash[:notice] = Thanks for signing up! 7 rescue ActiveRecord::RecordInvalid 8