Ruby On Rails Classroom image

Neha  Jaggi / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4|Last
Lessons:-Pretty RSpec

and

page.should  have  selector  ('h1',   text:    'Sample App')

 

which say essentially the same thing. In addition, both examples reference the page variable. We can eliminate these sources of duplication by telling RSpec that page is the subject of the tests using

subject   {  page  }  

 

and then using a variant of the it method to collapse the code and description into one line:

it  { should have selector  ( 'h1 ' text:   'Sample App' )  }  

 

Because of subject { page }, the call to should automatically uses the page variable supplied by Capybara (Section 3.2.1)  

                  Applying these changes gives much more compact tests for the Home page:

 

 

 

 
 
 
image
Neha  Jaggi

Skills    Ruby On Rails

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

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). 


Explore
 

  Students (0)