I am very new to rails and Rspec. I was following the tutorial - http://ruby.railstut...c-pages#sec-TDD. The author wrote the test code as below :
require 'spec_helper' describe "Static pages" do describe "Home page" do it "should have the content 'Sample App'" do visit '/static_pages/home' expect(page).to have_content('Sample App') end end describe "Help page" do it "should have the content 'Help'" do visit '/static_pages/help' expect(page).to have_content('Help') end end end
Now my question is why is it needed to put `describe "Home page"` and `describe "Help page"` block inside the `describe "Static pages"` block. Why are not we put the inside block on the top level ieself ?