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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:32:59+00:00 2026-06-07T07:32:59+00:00

Apparently I have a unique situation that I can’t find help with anywhere. I’m

  • 0

Apparently I have a unique situation that I can’t find help with anywhere. I’m trying to extend my sign up process to create extra models in my database. Here is a basic flow of what I’d like to do:

  • User Signs up with Email/Password (along with other model values)
  • System creates a ‘User’ model
  • System creates a ‘Profile’ model
  • System creates a ‘Company’ model
  • System creates an ‘Account’ model

The biggest challenge is that I’m using Devise and I can’t seem to figure out a way to test this functionality with Rspec. Here is a quick view of me simply trying to test the ‘Sign Up’ method (which does not work:

describe "New Users" do
  describe "signing up" do
    it "should create a new user" do
      lambda do
        post :sign_up, :user => Factory.attributes_for(:user)
        response.should be_success
      end.should change(User, :count).by(1)
    end
  end
end

I get the following error:

1) UsersController New Users signing up should create a new user
 Failure/Error: post :sign_up, :user => Factory.attributes_for(:user)
 ActionController::RoutingError:
   No route matches {:user=>{:email=>"test@user.com", :password=>"secret", :password_confirmation=>"secret"}, :controller=>"users", :action=>"sign_up"}
 # ./spec/controllers/users_controller_spec.rb:14:in `block (5 levels) in <top (required)>'
 # ./spec/controllers/users_controller_spec.rb:13:in `block (4 levels) in <top (required)>'

The Devise routes configure my user sign up routes as follows:

new_user_registration GET    /users/sign_up(.:format)  {:action=>"new", :controller=>"devise/registrations"}

I’ve been pulling my hair out with this, and can’t seem to find any help in this area. Perhaps I’m approaching it wrong, but I want to configure all the aspects of setting up a user’s account (ie. their company defaults, profile settings, etc..) on the initial sign up form. First I need to just figure out how to test the sign up process.

Thanks in advance!

  • 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-07T07:33:01+00:00Added an answer on June 7, 2026 at 7:33 am

    First of all the routes you should link to is, because devise are using a POST method for sign-up:

    user_registration POST   /users(.:format)                   devise/registrations#create
    

    Maybe you can try pass there syntax such as:

    it "should create a new user" do
    expect {
      post :create, user: FactoryGirl.attributes_for(:user)
      response.should be_redirect
    }.should change(User, :count).by(1)
    end
    

    EDIT
    Ok then, I maybe figure out how to solve the route problem, I added a new controller:

    UsersController < Devise::RegistrationsController 
    

    and also added there method sign_up. Then in routes.rb I added this code:

    devise_for :users
    devise_scope :user do
     post "/sign_up", :to => "devise/registrations#create"
    end
    

    and finally this line before the test into the test:

    @request.env["devise.mapping"] = Devise.mappings[:user]
    

    But I have there problem with validations, but I think it is for my app because I just made it in new branch on existing system. Hope it could help you. Nevertheless, I think this approach is quite hack or not common. I would rather go with recommended Devise approach. You can always create an user dependencies with FactoryGirl viz this link. Hope it will help you.

    BTW Sry for the nonsense post about sign in:) I was tired:)

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

Sidebar

Related Questions

I'm trying to use Enumerable.ToList() in PowerShell. Apparently, to do that, I have to
You can't have your cake and eat it too, apparently. I'm currently using the
I am trying this code, but apparently i have some bug. The problem is
Matlab has msgbox, listdlg, textscan, and many other functions that Octave apparently doesn't have.
** Solved ** Chrome can apparently have one heck of a death grip on
so apparently you have the following <select> <option value=0>One</option> <option value=1>Two</option> </select> $('select').val('1'); //
Hi I have a question about ruby on rails Apparently I have a statement
I'm only remotely familiar with what ant does, but apparently I have to setup
I have an apparently easy problem which is: <div class=container> <div class=a></div> <div class=b></div>
Paramiko's SFTPClient apparently does not have an exists method. This is my current implementation:

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.