Static Pages from Railcast

Other people have reported this error:

NoMethodError:
undefined method visit' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xa1695cc> # ./spec/requests/static_pages_spec.rb:7:in block (3 levels) in
<top (required)>’

google: rspec visit

In particular see:

You might want to post your Gemfile.

What i am doing wrong??

So I am at chapter 8, and everything seem to be working except that once
loggin I am apparently not login but do see some of the information such
as show correct user.

Here what I have
app/controllers/customers.rb
class CustomersController < ApplicationController

def show
@customer = Customer.find(params[:id])
end

def create
@customer = Customer.new(params[:customer])
if @customer.save
sign_in @customer
flash[:success] = “Welcome to Where you Where”
redirect_to @customer
# Handle a successful save.
else
render ‘new’
end
end

def new
@customer = Customer.new
end

def edit
@customer = Customer.find(params[:id])
end

def update
if @customer.update_attributes(params[:customer])
flash[:success] = “Profile updated”
sign_in @customer
redirect_to @customer
else
render ‘edit’
end
end

private

def signed_in_customer
  redirect_to signin_path, notice: "Please sign in." unless 

signed_in?
end

def correct_customer
  @customer = Customer.find(params[:id])
  redirect_to(root_path) unless current_customer?(@customer)
end

end

I have change the name of the resource from user to customer for trying
different then the person

this is my session help found in the folder
app/helpers/session.rb
module SessionsHelper

def sign_in(customer)
cookies.permanent[:remember_token] = customer.remember_token
self.current_customer= customer
end

def current_customer=(customer)
@current_customer = customer
end

def current_customer?(customer)
customer == current_customer
end

def current_customer
@current_customer ||=
Customer.find_by_remember_token(cookies[:remember_token])
end

def sign_in(customer)
cookies.permanent[:remember_token] = customer.remember_token
self.current_customer = customer
end

def signed_in?
!current_customer.nil?
end

def sign_out
cookies.delete(:remember_token)
self.current_customer = nil
end

end

Here his my header just in case i made a small mistake

  • <%= link_to "Home", root_path %>
  • <% if signed_in? %>
  • <%= link_to "Customers", '#' %>
  • Account
    • <%= link_to "Profile", current_customer %>
    • <%= link_to "Settings", '#' %>
    • <%= link_to "Sign out", signout_path, method: "delete" %>
  • <% else %>
  • <%= link_to "Sign in", signin_path %>
  • <% end %>

Again i only see sign and home as link has i am assuming something his
wrong with my sign process

Jean-Sébastien D. wrote in post #1069202:

Jim Oser wrote in post #1069201:

Other people have reported this error:

Thanks.

I am wondering if its actually possible to see into the application
controller other resources

Example

class ApplicationController < ActionController::Base
protect_from_forgery
include SessionsHelper
@pages = Page.all
end

app/layout/_footer.html.erb
<% @pages.each do |page| %>


  • <%= @page.name %>

  • <% end %>

    Thanks in advance