Thursday 15 August 2013

authentication - Ruby on Rails (Michael Hart Tutorial) authorization error (chapter 9.2.1) -


I am learning Ruby on Rails with Michael Hart's tutorials.
And now I'm stuck at Chapter 9.2.1.
Here is the code in the book:

Authentication_page_SPECRB requires 'spec_helper'

  Describe "authentication" {page} describes " Before going to "Signin_path" before signing on "" {signin_path} "should be with" invalid information "{click_button" sign in "} before () must be ('sign in')} ('' div.alert.alert -error '', text: 'invalid')} {click_link "Home"}} Please describe "after going to another page" {do_no__selector_selector ('div.alert.alert-e Rror ')} End End End End describes "with valid information" (user:) {Sign in} before {Sign_in user} should be {factoryGirl.create (: user)}} {_title (user.name)} ) Must be {__link ('sign out', href: signout_path)} ({profile ', href: user_path (user))}} {should (_ settings), href: edit_user_path (user))}} { Describe "after sign-in" (must be "sign in") before "The sign-link" (sign in 'sign in' sign_link "sign out"}, "end", "authorization" Describe the description of "In User Controller" ("Users"), describing "Edit User", go to "edit page" and go to "edit_user_path (user)}" Sign In '}} describes "Submit to Update Action" before the end user_path (user)} {response.should redirect_to (signin_path)} End And End And End   

But when I do the test:

  rspec spec /   

there are two errors that I have not Only know how to fix on the line: In this ('sign in')}

and the row should be:

  Specify {response.should redirect_to (signin_path)}   

Here is an error image:

Before you {sign_in user} inside block go to the edit page ".

But you have used it properly for other blocks like:

  let {Sign_in user}    < / Html> before (: user) {FactoryGirl.create (: user)}

No comments:

Post a Comment