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 8360851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:33:46+00:00 2026-06-09T11:33:46+00:00

_header.html.erb <header class=navbar navbar-fixed-top> <div class=navbar-inner> <div class=container> <%= link_to sample app, root_path, id:

  • 0

_header.html.erb

<header class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <%= link_to "sample app", root_path, id: "logo" %>
      <nav>
        <ul class="nav pull-right">
          <li><%= link_to "Home", root_path %></li>
          <li><%= link_to "Help", help_path %></li>
          <% if signed_in? %>
            <li><%= link_to "Users", '#' %></li>
            <li id="fat-menu" class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                Account <b class="caret"></b>
              </a>
              <ul class="dropdown-menu">
                <li><%= link_to "Profile", current_user %></li>
                <li><%= link_to "Settings", '#' %></li>
                <li class="divider"></li>
                <li>
                  <%= link_to "Sign out", signout_path, method: "delete" %>
                </li>
              </ul>
            </li>
          <% else %>
            <li><%= link_to "Sign in", signin_path %></li>
          <% end %>
        </ul>
      </nav>
    </div>
  </div>
</header>

user_pages_spec.rb

    describe "with valid information" do
        before do
            fill_in "Name",         with: "Example User"
            fill_in "Email",        with: "user@example.com"
            fill_in "Password",     with: "foobar"
            fill_in "Confirmation", with: "foobar"
        end

        it "should create a user" do
            expect { click_button submit }.to change(User, :count).by(1)
        end

        describe "after saving the user" do
            before { click_button submit }
            let(:user) { User.find_by_email('user@example.com') }

            it { should have_selector('title', text: user.name) }
            it { should have_selector('div.alert.alert-success', text: 'Welcome') }
            it { should have_link('Sign out') }
        end

        describe "followed by signout" do
            before { click_link "Sign out" }
            it { should have_link('Sign in') }
        end
    end

The failure is:

1) User pages signup with valid information followed by signout
Failure/Error: before ( click_link "Sign out" )
Capybara::ElementNotFound:
no link with title, id, or text 'Sign out' found
(eval):2:in 'click_link'
./spec/requests/user_pages_spec.rb:63:in 'block (5 levels) in (top (required))'

Following the create user process manually it appears to work. The link is in a drop down menu if maybe that might have something to do with it? This is at the point in the MHartl rails tutorial where he says all tests should pass.

  • 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-06-09T11:33:47+00:00Added an answer on June 9, 2026 at 11:33 am

    The suspect code apparently needs to be nested inside the inside the previous describe

            describe "after saving the user" do
                before { click_button submit }
                let(:user) { User.find_by_email('user@example.com') }
    
                it { should have_selector('title', text: user.name) }
                it { should have_selector('div.alert.alert-success', text: 'Welcome') }
                it { should have_link('Sign out') }
    
                describe "followed by signout" do
                    before { click_link "Sign out" }
                    it { should have_link('Sign in') }
                end
            end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application.html.erb (main layout) has some categories on the top of the header, and
In this html I basically have a sidebar-div and a page-div with the header,
In my html page, i fixed my header with : position : fixed When
http://0.0.0.0:3000/ Sprockets::FileNotFound in Home#index Showing /home/user1/rorblog/app/views/layouts/application.html.erb where line #6 raised: couldn't find file 'jquery'
File app/views/layouts/application.html.erb <!DOCTYPE html> <html> <head> <title><%= title %></title> <%= csrf_meta_tag %> <!--[if lt
I have a header.html which start with session_start();. Then the following code, $_SESSION['cart'][$sw_id] is
I have a file called header.html and it is included by base.html . In
Possible Duplicate: mail() header problem for html email I'm using the following for $headers
Here is my try: @header(Content-type: text/html; charset=utf-8); @header(Location:/index.php); @header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 @header(Expires:
I'm injecting the HTML for web page's header into the DOM via jquery (simulate

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.