Colin Law wrote in post #962775:
> On 20 November 2010 13:00, Neil Bye <[email protected]> wrote:
>> => #<Annnette id: 3, story: "neil", created_at: "2010-11-20 12:58:11",
>> updated_at: "2010-11-20 12:58:11">
>
> I am losing track of this conversation. I think we had better start
> again. Can you explain:
> 1. What the test you wrote is attempting to check.
> 2. What code you have written in the application to perform the
> operation that the test is checking.
>
> Colin
1.It should show an error if an attempt is made to create a story
without a story entry.
2.This is from annnettes_controller.rb
def create
@annnette = Annnette.new(params[:annnette])
respond_to do |format|
if @annnette.save
flash[:notice] = 'Annnette was successfully created.'
format.html { redirect_to(@annnette) }
format.xml { render :xml => @annnette, :status => :created,
:location => @annnette }
else
format.html { render :action => "new" }
format.xml { render :xml => @annnette.errors, :status =>
:unprocessable_entity }
end
end
end
It is a very simple app made with scaffold to try and understand the
problems with my main app which started this thread.
--
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 this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.