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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:44:55+00:00 2026-06-12T21:44:55+00:00

When running some test with RSpec, I get this error (multiple times): 1) User

  • 0

When running some test with RSpec, I get this error (multiple times):

1) User Pages edit with valid information 
     Failure/Error: visit edit_user_path(user)
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/views/users/edit.html.haml:15:in `block in _app_views_users_edit_html_haml__2466546393595631499_70225077026800'
     # ./app/views/users/edit.html.haml:6:in `_app_views_users_edit_html_haml__2466546393595631499_70225077026800'
     # ./spec/requests/user_pages_spec.rb:54:in `block (3 levels) in <top (required)>'

I’m not familiar with reading Rails error messages; is this telling me the method being called with the wrong number of arguments is in edit.html.haml, or in user_pages_spec.rb? Is it saying that edit_user_path is being called with 0 arguments?

Edit to add my code:

edit.html.haml:

- provide(:title, "Edit user")
%h1 Update your profile

.row
    .span6.offset3
        = form_for(@user) do |f|

            = f.label :name
            = f.text_field :name

            = f.label :email
            = f.text_field :email

            = f.label :password
            = f.password_field

            = f.label :password_confirmation, "Confirm Password"
            = f.password_field :password_confirmation

            = f.submit "Save changes", class: "btn btn-large btn-primary"

Relevant portion of user_pages_spec.rb:

describe "edit" do
        let(:user) { FactoryGirl.create(:user) }
        before do
            sign_in user
            visit edit_user_path(user)
        end

        describe "page" do
            it { should have_selector('h1',    text: "Update your profile") }
            it { should have_selector('title', text: "Edit user") }
        end

        describe "with invalid information" do
            before { click_button "Save changes" }

            it { should have_content('error') }
        end

        describe "with valid information" do
            let(:new_name) { "New Name" }
            let(:new_email) { "new@example.com" }
            before do
                fill_in "Name",             with: new_name
                fill_in "Email",            with: new_email
                fill_in "Password",         with: user.password
                fill_in "Confirm Password", with: user.password
                click_button "Save changes"
            end

            it { should have_selector('title', text: new_name) }
            it { should have_success_message('') }
            it { should have_link('Sign out', href: signout_path) }
            specify { user.reload.name.should == new_name }
            specify { user.reload.email.should == new_email }
        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-06-12T21:44:57+00:00Added an answer on June 12, 2026 at 9:44 pm

    Basically, wrong number of arguments means that for the method, it thinks that you should be passing a certain number of variables in, and it’s receiving the wrong amount.

    In this case, it expects 1 variable to be passed in and it’s receiving none.

    From the looks of it, you should be looking at line 15 of your edit.html.haml file, which I’m guessing is here:

    = f.label :password
    = f.password_field
    

    It looks like you’re missing :password — passing the actual variable in.

    So change it to:

    = f.password_field :password
    

    and you should be good.

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

Sidebar

Related Questions

I am getting this error when running some unit tests (using the Test::Unit module
I'm running some test to prove a concept and i just wrote this code
So i'm trying to get familiar with jQuery, so i've been running some test
I have some code that attempts to test whether my application is running with
I'm currently running some SQL which uses an IN expression to match against multiple
At some point I started getting test output when running rake tasks, and I
When running some long integration test sequences, we stub Time to have controllable relative
I have trouble running some test cases, which broke after I upgraded the api
I am running some unit test that persist documents into the MongoDb database. For
for my master thesis, i am running some test on the SIFT SURF en

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.