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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:57:04+00:00 2026-06-16T03:57:04+00:00

i am getting a syntax error my test code is require ‘spec_helper’ describe User

  • 0

i am getting a syntax error
my test code is

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) }

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

and error logs are

/home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load': /home/ritesh/projects/sample_app/spec/requests/user_pages_spec.rb:30: syntax error, unexpected tIDENTIFIER, expecting keyword_end (SyntaxError)
fill_in "Email"  with: "user@example.com"
                     ^
/home/ritesh/projects/sample_app/spec/requests/user_pages_spec.rb:31: syntax error, unexpected tIDENTIFIER, expecting keyword_end
fill_in "password" with: "foobar"
                       ^
/home/ritesh/projects/sample_app/spec/requests/user_pages_spec.rb:32: syntax error, unexpected tIDENTIFIER, expecting keyword_end
fill_in "confirmation" with: "foobar"
                           ^
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'

please help me how to rectify it!!

  • 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-16T03:57:06+00:00Added an answer on June 16, 2026 at 3:57 am

    Taking pride in the way your code looks will help you find syntax issues; in this case, commas in the fill_in lines after the first parameter.

    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) }
        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
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting syntax error in firebug here is the code : $('#moderator-attention').live('toogle', function(){ function
Why am I getting a syntax error with the following line? statement = self.sql.execute(DESCRIBE
i am using this code <a onclick=javascript:var t=setInterval(GetUpdates(5,ajaxResult),300);>GetUpdates</a> but getting the syntax error
I am getting a very confusing compiler error when building the following test code.
I'm getting a syntax error in this simple javascript code. I just want to
I'm getting a syntax error (undefined line 1 test.js) in Firefox 3 when I
I am getting syntax error with the following statement REPLACE INTO users (screenname, token,
I'm trying to do: raw_input(Anyone Home?) But I'm getting syntax error! I'm using Python
I'm getting a syntax error with this access query, but I can't see what
I'm getting $ syntax error, unexpected keyword_class, expecting keyword_do or '{' or '(' in

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.