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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:12:16+00:00 2026-05-22T23:12:16+00:00

I am facing an error trying to configure omniauth for integration testing purpose with

  • 0

I am facing an error trying to configure omniauth for integration testing purpose with cucumber (I set up Omniauth through Devise as the wiki provides)

Please see below:

Scenario: Test                       # features/omniauth.feature:3
  Given I am signed in with facebook # features/step_definitions/omniauth_steps.rb:1
    bad component(expected host component): http://www.example.com (URI::InvalidComponentError)
    /Users/benoit/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/uri/generic.rb:395:in `check_host'
    /Users/benoit/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/uri/generic.rb:409:in `host='
    ./features/step_definitions/omniauth_steps.rb:2:in `/^I am signed in with facebook$/'
    features/omniauth.feature:4:in `Given I am signed in with facebook'
  Then I open the page               # features/step_definitions/debug_steps.rb:5

Here are my files:

omniauth.feature

Feature: OmniAuth

  Scenario: Test
    Given I am signed in with facebook
    Then I open the page

omniauth_steps.rb

Given /^I am signed in with facebook$/ do
  visit "/auth/facebook"
end

support/env.rb

OmniAuth.config.test_mode = true
OmniAuth.config.mock_auth[:facebook] = {
  'uid' => '12345',
  "user_info" => {
    "email" => "foobar@example.com",
    "first_name" => "foo",
    "last_name" => "Bar"
  }
}

initializer/devise.rb

case 
  when Rails.env.production?
    config.omniauth :facebook, 'XXXX', 'XXXX', 
    {:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
  when Rails.env.development?
    config.omniauth :facebook, 'XXXX', 'XXXX'
  when Rails.env.test?
    config.omniauth :facebook, 'XXXX', 'XXXX'
        OmniAuth.config.full_host = 'http://example.com' # issue 257  
end

(Reference: issue 257)

routes

devise_scope :user do 
  get '/auth/:provider' => 'users/omniauth_callbacks#passthru'
end

devise_for :users, :path => "", :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

As info, I also configured my facebook test_app with the following URL: http://example.com/

I would be pleased to know if someone has a thought/experienced this.
Thank you!

  • 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-22T23:12:17+00:00Added an answer on May 22, 2026 at 11:12 pm

    try to add :

    Before do
      Capybara.default_host = 'example.com'
    end
    

    to your support/env.rb file, try also commenting out :

    OmniAuth.config.full_host = 'http://example.com' # issue 257
    

    from your initializer/devise.rb file.

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

Sidebar

Related Questions

I am facing this error, Cannot create unknown Type '{clr- namespace:ActivityLibrary1;assembly=ActivityLibrary1}MyActivity1' while trying to
I'm facing a problem while unit testing my forms. The problem is that data
I am new to Haskell and facing a "cannot construct infinite type" error that
I am currently facing an error called Bad Base64Coder input character at ... Here
jquery datepicker is a great fun but I am facing a weird error. I
I am facing problem with an Oracle Query in a .net 2.0 based windows
I am facing a problem with .NET generics. The thing I want to do
I'm facing a problem with IE6. I took the toggle function from this website
I have a public facing website that has been receiving a number of SQL
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing

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.