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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:32:24+00:00 2026-06-05T07:32:24+00:00

I’ve been having trouble trying to get my test to pass. I think the

  • 0

I’ve been having trouble trying to get my test to pass. I think the issue is with my signin_path, but I can’t figure out where exactly the problem is, any help would be greatly appreciated!

Here is the Failure message (it’s long. sorry about that):

bundle exec rspec spec/......................FFFFFFFFFFFFFFFFFF

Failures:

  1) Authentication signin page 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in          `    _app_views_layouts__header_html_erb__3520387809765840673_2170500560'
 # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
 # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

2) Authentication signin page 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

  3) Authentication signin with invalid information 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  4) Authentication signin with invalid information 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  5) Authentication signin with invalid information after visiting another page 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  6) Authentication signin with valid information 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  7) Authentication signin with valid information 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
    # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  8) Authentication signin with valid information 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  9) Authentication signin with valid information 
     Failure/Error: before { visit signin_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/authentication_pages_spec.rb:15:in `block (3 levels) in <top (required)>'

  10) Static pages Home page 
     Failure/Error: before { visit root_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/static_pages_spec.rb:12:in `block (3 levels) in <top (required)>'

  11) Static pages Home page it should behave like all static pages 
     Failure/Error: before { visit root_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     Shared Example Group: "all static pages" called from ./spec/requests/static_pages_spec.rb:16
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/static_pages_spec.rb:12:in `block (3 levels) in <top (required)>'

  12) Static pages Home page it should behave like all static pages 
     Failure/Error: before { visit root_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     Shared Example Group: "all static pages" called from ./spec/requests/static_pages_spec.rb:16
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/static_pages_spec.rb:12:in `block (3 levels) in <top (required)>'

  13) User pages signup page 
     Failure/Error: before { visit signup_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/user_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

  14) User pages signup page 
     Failure/Error: before { visit signup_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/user_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

  15) User pages profile page 
     Failure/Error: before { visit user_path(user) }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/user_pages_spec.rb:17:in `block (3 levels) in <top (required)>'

  16) User pages profile page 
     Failure/Error: before { visit user_path(user) }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/user_pages_spec.rb:17:in `block (3 levels) in <top (required)>'

  17) User pages signup with invalid information should not create a user
     Failure/Error: before { visit signup_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/user_pages_spec.rb:26:in `block (3 levels) in <top (required)>'

  18) User pages signup with valid information should create a user
     Failure/Error: before { visit signup_path }
     ActionView::Template::Error:
       wrong number of arguments (0 for 1)
     # ./app/helpers/sessions_helper.rb:17:in `current_user'
     # ./app/helpers/sessions_helper.rb:10:in `signed_in?'
     # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb__3520387809765840673_2170500560'
     # ./app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___1084806681328616491_2159679840'
     # ./spec/requests/user_pages_spec.rb:26:in `block (3 levels) in <top (required)>'

Finished in 0.54083 seconds
40 examples, 18 failures

Failed examples:

rspec ./spec/requests/authentication_pages_spec.rb:10 # Authentication signin page 
rspec ./spec/requests/authentication_pages_spec.rb:11 # Authentication signin page 
rspec ./spec/requests/authentication_pages_spec.rb:20 # Authentication signin with invalid     information 
rspec ./spec/requests/authentication_pages_spec.rb:21 # Authentication signin with invalid information 
rspec ./spec/requests/authentication_pages_spec.rb:25 # Authentication signin with invalid information after visiting another page 
rspec ./spec/requests/authentication_pages_spec.rb:37 # Authentication signin with valid information 
rspec ./spec/requests/authentication_pages_spec.rb:38 # Authentication signin with valid information 
rspec ./spec/requests/authentication_pages_spec.rb:39 # Authentication signin with valid information 
rspec ./spec/requests/authentication_pages_spec.rb:40 # Authentication signin with valid information 
rspec ./spec/requests/static_pages_spec.rb:17 # Static pages Home page 
rspec ./spec/requests/static_pages_spec.rb:7 # Static pages Home page it should behave like all static pages 
rspec ./spec/requests/static_pages_spec.rb:8 # Static pages Home page it should behave like all static pages 
rspec ./spec/requests/user_pages_spec.rb:10 # User pages signup page 
rspec ./spec/requests/user_pages_spec.rb:11 # User pages signup page 
rspec ./spec/requests/user_pages_spec.rb:19 # User pages profile page 
rspec ./spec/requests/user_pages_spec.rb:20 # User pages profile page 
rspec ./spec/requests/user_pages_spec.rb:31 # User pages signup with invalid information should not create a user
rspec ./spec/requests/user_pages_spec.rb:47 # User pages signup with valid information should create a user

Here is the authentication_pages_spec.rb
require ‘spec_helper’

   describe "Authentication" do

     subject { page }

      describe "signin page" do
        before { visit signin_path }

       it { should have_selector('h1', text: 'Sign in') }
       it { should have_selector('title', text: 'Sign in') }
     end

     describe "signin" do
       before { visit signin_path }

       describe "with invalid information" do
         before { click_button "Sign in"}

         it { should have_selector('title', text: 'Sign in') }
         it { should have_selector('div.alert.alert-error', text: 'Invalid') }

         describe "after visiting another page" do
           before { click_link "Home" }
           it { should_not have_selector('div.alert.alert-error') }
         end
       end

     describe "with valid information" do
       let(:user) { FactoryGirl.create(:user) }
       before do
         fill_in "Email", with: user.email
         fill_in "Password", with: user.password
         click_button "Sign in"
       end

        it { should have_selector('title', text: user.name) }
        it { should have_link('Profile', href: user_path(user)) }
       it { should have_link('Sign out', href: signout_path) }
       it { should_not have_link('Sign in', href: signin_path) }
       end
     end
   end

Here is the static_pages_spec.rb

   require 'spec_helper'

   describe "Static pages" do  
     subject { page }

     shared_examples_for "all static pages" do
       it { should have_selector('h1', text: heading) }
       it { should have_selector('title', text: full_title(page_title)) }
      end

     describe "Home page" do
       before { visit root_path }
      let(:heading)   { 'Sample App' }
      let(:page_title) { '' } 

      it_should_behave_like "all static pages"
      it { should_not have_selector 'title',   text: '| Home' }
       end

     describe "Help page" do
       before { visit help_path }
     let(:heading) { 'Help' }
     let(:page_title) { 'Help' }
      end

     describe "About Us page" do
       before { visit about_path }
     let(:heading) { 'About Us' }
     let(:page_title) { 'About Us' }
      end

     describe "Contact page" do
        before { visit contact_path }
     let(:heading) { 'Contact' }
     let(:page_title) { 'Contact' }
      end
   end

Here is the user_pages_spec.rb:

   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) }
       #Code to make a user variable
       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
       end
     end  
   end

Here is the session_helper.rb:

   module SessionsHelper
     require 'sessions_helper'

     def sign_in(user)
       cookies.permanent[:remember_token] = user.remember_token
       self.current_user = user
     end

     def signed_in?
        !current_user.nil?
     end

     def current_user=(user)
       @current_user = user
     end

     def current_user(user)
       @current_user ||= User.find_by_remember_token(cookies[:remember_token])
      end
end

I haven’t figured out how to get HTML to post, but if it would be helpful to see the applicaiton.html.erb and the _header.html.erb, just let me know and I will keep trying. Any thoughts would be greatly appreciated! thanks!

  • 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-05T07:32:26+00:00Added an answer on June 5, 2026 at 7:32 am

    The last method in your SessionsHelper module, current_user, doesn’t need to take an argument user. This is why you see the error “wrong number of arguments (0 for 1).”

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a jquery bug and I've been looking for hours now, I can't
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:

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.