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

  • Home
  • SEARCH
  • 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 6795019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:17:33+00:00 2026-05-26T18:17:33+00:00

I’m totally stumped on this error. Would really appreciate some help :). To reproduce

  • 0

I’m totally stumped on this error. Would really appreciate some help :).

To reproduce the error, you can pull the program from https://github.com/WaleyChen/twitter_clone. Then run ‘bundle exec rspec spec/’.

I have an rspec test for my controller defined as:

require 'spec_helper'

describe FrontpageController do
  render_views # render the views inside the controller tests, so not just test the actions

  describe "GET 'frontpage'" do
    it "should be successful" do
      get 'frontpage'
      response.should be_success
    end

    it "should have the right title" do
      get 'frontpage'
      response.should have_selector("title", :content => "Twitter")
    end
  end

end

When I run my rspec tests, I get the following error:

Failures:

1) FrontpageController GET 'frontpage' should be successful
 Failure/Error: get 'frontpage'
 ActionView::Template::Error:
   undefined method `full_name' for #<User:0x007fbfce43dce0>
 # ./app/views/frontpage/frontpage.html.erb:22:in `block in _app_views_frontpage_frontpage_html_erb___4518234645475110659_70230885952360'
 # ./app/views/frontpage/frontpage.html.erb:21:in `_app_views_frontpage_frontpage_html_erb___4518234645475110659_70230885952360'
 # ./spec/controllers/frontpage_controller_spec.rb:8:in `block (3 levels) in <top (required)>'

2) FrontpageController GET 'frontpage' should have the right title
 Failure/Error: get 'frontpage'
 ActionView::Template::Error:
   undefined method `full_name' for #<User:0x007fbfcc99a410>
 # ./app/views/frontpage/frontpage.html.erb:22:in `block in _app_views_frontpage_frontpage_html_erb___4518234645475110659_70230885952360'
 # ./app/views/frontpage/frontpage.html.erb:21:in `_app_views_frontpage_frontpage_html_erb___4518234645475110659_70230885952360'
 # ./spec/controllers/frontpage_controller_spec.rb:13:in `block (3 levels) in <top (required)>'

Here’s the controller:

class FrontpageController < ApplicationController
  def frontpage
    @user = User.new
    @sign_up = User.new
  end

  def sign_up
    if @post.save
      format.html { redirect_to @post, notice: 'Post was successfully created.' }
    end
  end
end

Here’s the view, that’s causing the error:

<%= form_for @user, :url =>"sign_up" do |form| %>
  <%= form.text_field :full_name, :placeholder => "Full name" %>
  </br>
  <%= form.text_field :email, :placeholder => "Email" %>
  </br>
  <%= form.text_field :pw, :placeholder => "Password" %>
  </br>
  <%= form.text_field :username, :placeholder => "Username" %>
  </br>
  <%= form.submit "Sign up" %>
<% end %>

Here’s user.rb:

class User < ActiveRecord::Base
end

Here’s schema.rb:

ActiveRecord::Schema.define(:version => 20111106084309) do

  create_table "users", :force => true do |t|
    t.string   "full_name"
    t.string   "email"
    t.string   "username"
    t.string   "pw"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

end
  • 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-26T18:17:33+00:00Added an answer on May 26, 2026 at 6:17 pm

    You need to make sure your test database is up to date with all the migrations:

    rake db:test:prepare
    

    However, you may have a problem with that as your migrations are broken; you have two migrations named “CreateUsers” which Rails will complain about. It looks like you should delete the more recent one, and then uncomment the t.string :email line in the original one.

    Also, if you use bundle exec rake rspec instead of bundle exec rspec spec it’ll make sure your database migrations are up to date before running the tests. I just cloned your repo and did this and it passed the tests just fine.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.