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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:49:17+00:00 2026-05-23T09:49:17+00:00

I have integrated rails application with omniauth and devise integration. In one the controller

  • 0

I have integrated rails application with omniauth and devise integration. In one the controller I have –

def create
     # some 
     # stuff 
     # here
   sign_in_and_redirect(:person, @person)
     # some 
     # stuff 
     # here
 end 

as this action is from devise, i shouldn’t be testing this action but only presence of it(correct me here if i am wrong.). Also, as I am mocking this person object, it doesn’t have methods to pass origin sign_in_and_redirect action.

So, how can test this controller ?

UPDATE

I tried this in my before do block –

controller.stub!(:sign_in_and_redirect).and_return(true)

But this give me error as – Missing templace authentications/create
I don’t have any create.html.erb, as it redirects in normal workflow.


UPDATE

My AuthencationController#create method code can be seen here – http://www.pastie.org/2116067
My Test code can be seen here – http://www.pastie.org/2116081

  • 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-23T09:49:17+00:00Added an answer on May 23, 2026 at 9:49 am

    Finally I found that it has to do with devise.

    This solved issues – devise wiki – How To: Controllers and Views tests with Rails 3 (and rspec)

    I had to include support/devise.rb file and below lines –

    RSpec.configure do |config|
       config.include Devise::TestHelpers, :type => :controller
    end
    

    After that I just added required methods to person class by stubbing it and it worked.

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

Sidebar

Related Questions

I have successfully integrated google ajax search with rails application . Does Google Ajax
I have a Rails 3 application using Devise for authentication. In addition to the
I have a Rails 3 application using Devise for authentication. Now I need to
I have a Rails app with devise integrated. I'm using the Cookie Store session.
I have recently integrated the .NET NLog logging component into one of our applications
I have a new application starting that's using Rails 2.3.8 for stability concerns and
I have a script that appends some rows to a table. One of the
I have a couple of Rails apps I'm looking to integrate with OmniAuth, but
last week, I integrated successfully twitter with my small rails app. If I create
I am using Devise in my Ruby on Rails 3 application. I am trying

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.