Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby on Rails Tutorial by Michael Hartl. Failing test in Chapter 8.29
    primarykey
    data
    text
    <p>I am a newbie working through Hartl. Got to the end of Chapter 8 and when I check my browser for the sign in/sign out every things seems AOK. However when I run this test:</p> <pre><code>$ bundle exec spec spec/ </code></pre> <p>returns</p> <pre><code>sis-macbook-pro:sample_app Lagaspi$ bundle exec rspec spec/ ..............................F Failures: 1) User pages signup with valid information after saving the user Failure/Error: it { should have_link('Sign out') } expected link "Sign out" to return something # ./spec/requests/user_pages_spec.rb:48:in `block (5 levels) in &lt;top (required)&gt;' Finished in 0.60715 seconds 31 examples, 1 failure Failed examples: rspec ./spec/requests/user_pages_spec.rb:48 # User pages signup with valid information after saving the user </code></pre> <p>I have an idea but i'm not exactly sure. So here's my user_pages_spec.rb file:</p> <pre><code>require 'spec_helper' describe "User pages" do subject { page } describe "signup page" do before { visit signup_path } it { should have_selector('h1', text: 'Sign up') } it { should have_selector('title', text: full_title('Sign up')) } end describe "profile page" do let(:user) { FactoryGirl.create(:user) } before { visit user_path(user) } it { should have_selector('h1', text: user.name) } it { should have_selector('title', text: user.name) } end describe "signup" do before { visit signup_path } let(:submit) { "Create my account" } describe "with invalid information" do it "should not create a user" do expect { click_button submit }.not_to change(User, :count) end end 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 } it { should have_link('Sign out') } end end end end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload