Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7414245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:04:18+00:00 2026-05-29T07:04:18+00:00

How would I best go about testing the completeness of a page’s structural completeness?

  • 0

How would I best go about testing the completeness of a page’s structural completeness?

As an example, I would like to make sure that the site menu has all required elements. It is built with a regular CSS-formatted and has elements as these:

<li><%= link_to "Some page", some_path %></li>
...
<li><%= link_to "Login", path_to_login_action %></li>
<li><%= link_to "Register", path_to_registration_action %></li>

Or is this in some way pointless anyway? (still trying to develop a sound understanding for testing style)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:04:20+00:00Added an answer on May 29, 2026 at 7:04 am

    You could use the assert_select method:

    describe "home page" do
      it "diplays all menu elements" do
        get "/home"
        assert_select "ul.menu li" do
          assert_select "a.first", "Some page"
          assert_select "a.another-class", "Login"
          assert_select "a.last", "Register"
        end
      end
    end
    

    in another case, include webrat or capybara in your Gemfile:

     gem 'capybara'
     gem 'webrat'
    

    and use the have_selector method:

    describe "home page" do
      it "diplays all menu elements" do
        visit "/home"
        within "ul.menu li" do 
          page.should have_selector("a.first", :text => "Some page")
          page.should have_selector("a.another-class", :text => "Login")
          page.should have_selector("a.last", :text => "Register")
        end
      end
    end
    

    Read more about Rspec-rails: http://github.com/rspec/rspec-rails#readme (see “Request Specs” chapter)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently testing this environment and would like to ask about the best
I would like your advice about how best to solve my problem. In a
Just thinking about the best way to build an Order form that would (from
What's the best way to go about simulating how a current page would render
What would be the best way to go about finding what the active control
What would be best practice to localize your ASP.NET MVC application? I would like
I would like to know the best way to profile app code on OS
What would be the best way to create unit tests for testing the parameters
I would like to know what would be the best way to do unit
does anyone know of any web application stress testing best practice documents? I'm about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.