Expected response to be a <:success>,but was <500>

Hi,Man
     I write some integration test,like follow

500

500

> was
> [quote]
> Expect response to be a <:success>,but was <500>
> [/quote]
> Am I missing something ?

what is output in test log file?

You did not answer this question (look in log/test.log after running
test). If you delete the file before running the test you will start
with an empty file, obviously.

Colin

500

was

[quote]

Expect response to be a <:success>,but was <500>

[/quote]

Am I missing something ?

what is output in test log file?

You did not answer this question (look in log/test.log after running

test). If you delete the file before running the test you will start

with an empty file, obviously.

Colin

you can try this on console

follow the steps

1)go to console (ruby script/console)

2)app.get “/catalog”

see what response you get

Posted via http://www.ruby-forum.com/.

Sons of Gondor, of Rohan, my brothers!

I see in your eyes the same fear that would take the heart of me.

A day may come when the courage of men fails when we forsake our friends and

break all bonds of fellowship.

But this is not this day.

And hour of wolves and shattered shields when the age of Men comes crashing

down. But this is not this day!

This day we fight! By all that you hold dear on this good earth, I bid you

stand! Men of the West!

test.log (1.33 MB)

Session ID: 6efd9f650c0eb779f4726c3b5b0c609c
Parameters: {}

ActionController::RoutingError (No route matches “/catalog” with {:method=>:get}):
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path’

C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request'

C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'

C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/integration.rb:279:in `process'

C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/integration.rb:172:in `get'
test/integration/browsing_and_searching_test.rb:17:in `browse_index'
test/integration/browsing_and_searching_test.rb:8:in `test_browsing_the_site'

C:/Ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `__send__'
C:/Ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/integration.rb:547:in `run'

C:/Ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
C:/Ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
C:/Ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
C:/Ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'

C:/Ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
C:/Ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
C:/Ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
C:/Ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator'
C:/Ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
C:/Ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
C:/Ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'

C:/Ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
C:/Ruby/lib/ruby/1.8/test/unit.rb:278
test/integration/browsing_and_searching_test.rb:30

Rendering C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb (not_found)

Session ID: 6efd9f650c0eb779f4726c3b5b0c609c
Parameters: {}

ActionController::RoutingError (No route matches "/catalog" with
{:method=>:get}):

Well there you are then. No one has asked the obvious question, as it
is too obvious to require asking, what happens if you run your server
and go to /catalog?

Colin

fireflyman wrote:

Session ID: 6efd9f650c0eb779f4726c3b5b0c609c
  Parameters: {}

ActionController::RoutingError (No route matches "/catalog" with
{:method=>:get}):

Rendering
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb
(not_found)

ActionController::RoutingError (No route matches "/catalog" with
{:method=>:get}):

clearly above line indicated that you don't have route for the method
and
app.get "/catalog"
gives 500 indicates you dont have url like this
"www.yourdomain.com/catalog"
(No route matches "/catalog" with {:method=>:get}):

So,What should I do ?I’m a fresher.

fireflyman wrote:

So,What should I do ?I'm a fresher.

go to

http://guides.rubyonrails.org/testing.html
http://6brand.com/rails-integration-testing-how-to-learn.html

read about rails integration testing

do

rake routes

you will get all the routes in your application
then perform integration testing

Thanks so much ! You are good man!@

Thanks so much ! You are good man!@

fireflyman wrote:
> So,What should I do ?I'm a fresher.

go to

http://guides.rubyonrails.org/testing.html
http://6brand.com/rails-integration-testing-how-to-learn.html

read about rails integration testing

do
>>rake routes
you will get all the routes in your application
then perform integration testing

Also work through the getting starting guide if you have not already
done so. I would suggest actually working through it as a tutorial
rather than just reading it.

Colin