Ruby On Rails Classroom image

Neha  Jaggi / Professional / Web Technology

To post your Question Join Classroom
Lesson Topics's No:-  ||
Lessons:- Route Tests

  Route Tests

With the work we’ve done writing integration test for the static pages, writing tests for the routes is simple: We just replace each occurrence of a hard-coded address with the desired named route from Table 5.1. In other words, we change


visit      '/static pages/about'



  visit  about   path


and so on for the other pages. The result appears in Listing 5.20.


Listing 5.20 Tests for the named routes.







As usual, you should check that the tests are now red:

$   bundle  exec  rspec  spec/requests/static  pages  spec.rb


                     By the way, if the code in Listing 5.20 strikes you as repetitive and verbose, you’re not alone. We’ll refactor this mess into a beautiful jewel in Section 5.3.4.  

Neha  Jaggi

Skills    Ruby On Rails

Qualifications :- High School - , College/University - Graphic Era Hill University, Dehradun, College/University - ,
Location :-Dehradun,Dehradun,UTTARAKHAND,India

Experienced Software Developer with a demonstrated history of working in the Information Technology and services industry. Skilled in Web Technologies (Ruby on Rails, PostgreSQL, php, Laravel and AJAX). 


  Students (0)