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 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 trying to use LDAP login to ezpublish but I am facing this
I am facing an issue while trying to use the spring android framework. I
I am facing this problem while trying to run my java file by writing
I am trying to call a web service but facing a strange behavior. we
I am trying to expand my template programming skills and I am facing a
Like any other question I am facing problem whenever I am trying to UPDATE
I'm trying to make a Java connection with SQL Server, but I'm facing some
I have VisualSVN Server and I want to create an internet facing repository on
We sucessfully implementedSpring , hibernate +jpa in our application with Xa transcation.but we trying
I'm trying to serialize a bool object using in the element text and I'm

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.