Ruby On Rails Classroom image

Anil  Bist / 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
Anil  Bist

Skills    Ruby On Rails

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)