How do we do functional test in Rails?

Hi all,

I've just started doing functional testing in Rails. I want to test my
controller whether it displays the page correctly or not. This is the
test code that I have written:

Well, if there are no rows in the projects table whose code column is
"PR", Project.find_by_code is doing to return nil. Have you properly
set up your fixtures or otherwise seeded your test database?

Do you have your model relationships setup properly? (project has_many
releases and releases belongs_to project?)