Hi,Man I write some integration test,like follow ------------------------------------------------ [code] require "#{File.dirname(__FILE__)}/../test_helper" class BrowsingAndSearchingTest < ActionController::IntegrationTest fixtures :publishers, :authors, :books, :authors_books def test_browsing_the_site jill = enter_site(:jill) jill.browse_index end private module BrowsingTestDSL attr_writer :name def browse_index get "/catalog" assert_response :success assert_template "catalog/index" assert_tag :tag => "dl", :attributes => { :id => "books"}, :children => { :count => 10, :only => {:tag => "dt"}} assert_tag :tag => "dt", :content => "The Idiot" end end def enter_site(name) open_session do |session| session.extend(BrowsingTestDSL) session.name = name yield seesion if block_given? end end end [/code] ------------------------------------------ but when i run the integration test,it go wrong,the wrong information was [quote] Expect response to be a <:success>,but was <500> [/quote] Am I missing something ?
> was > [quote] > Expect response to be a <:success>,but was <500> > [/quote] > Am I missing something ?what is output in test log file? 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/.
500 On Mon, Aug 31, 2009 at 2:40 PM, Nik Cool <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > > > was > > [quote] > > Expect response to be a <:success>,but was <500> > > [/quote] > > Am I missing something ? > > what is output in test log file? > > 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! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2009/8/31 fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> 500 > > On Mon, Aug 31, 2009 at 2:40 PM, Nik Cool <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> >> >> > 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! > > > > > >
[This email is either empty or too large to be displayed at this time]
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) On Mon, Aug 31, 2009 at 6:17 PM, fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Mon, Aug 31, 2009 at 6:00 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> >> 2009/8/31 fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> > 500 >> > >> > On Mon, Aug 31, 2009 at 2:40 PM, Nik Cool < >> rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> > wrote: >> >> >> >> >> >> > 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! >> > >> > >> > >> > > >> > >> >> >> >> > > > -- > 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! > > >-- 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! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2009/8/31 fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> 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> 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) > > On Mon, Aug 31, 2009 at 6:17 PM, fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> On Mon, Aug 31, 2009 at 6:00 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >>> >>> 2009/8/31 fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >>> > 500 >>> > >>> > On Mon, Aug 31, 2009 at 2:40 PM, Nik Cool >>> > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >>> > wrote: >>> >> >>> >> >>> >> > 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! >>> > >>> > >>> > >>> > > >>> > >>> >>> >> >> >> >> -- >> 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! >> >> > > > > -- > 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! > > > > > >
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}): -- Posted via http://www.ruby-forum.com/.
So,What should I do ?I''m a fresher. On Mon, Aug 31, 2009 at 6:46 PM, Nik Cool <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > 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}): > > > > > > > > > > -- > 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! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 routesyou will get all the routes in your application then perform integration testing -- Posted via http://www.ruby-forum.com/.
Thanks so much ! You are good man!@ On Tue, Sep 1, 2009 at 12:55 PM, Nik Cool <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > 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 > > > -- > 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! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2009/9/1 fireflyman <yangxiwenhuai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Thanks so much ! You are good man!@ > > On Tue, Sep 1, 2009 at 12:55 PM, Nik Cool <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> >> 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>> -- >> 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! > > > > > >