Ruby On Rails Classroom image

prateek  darmwal / 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
prateek  darmwal

Skills    Ruby On Rails

Qualifications :- High School - S.K.M. Sn. Sec. School, Haldwani, College/University - Graphic Era Hill University, Bhimtal,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:- I like to explore new technologies. I have skills in ruby on rails, php5, cakephp, jquery, javascript, html/css, java, c & c++. I love coding
Explore
 

  Students (0)