Skip to content

Instantly share code, notes, and snippets.

@oakbow
Last active August 3, 2017 09:52
Show Gist options
  • Save oakbow/6ed8a5893fd30eb0bfda2fe2ae383d91 to your computer and use it in GitHub Desktop.
Save oakbow/6ed8a5893fd30eb0bfda2fe2ae383d91 to your computer and use it in GitHub Desktop.
feature spec toward subdomain ref: http://qiita.com/Oakbow/items/3da1b20ff17e5e192f47
# You need to add your domain into Capybara's whitelist.
RSpec.configure do |config|
Capybara::Webkit.configure do |c|
c.block_unknown_urls
c.allow_url("admin.lvh.me")
end
Capybara.default_selector = :css
:
require "rails_helper"
feature "Users", type: :feature, js: true do
background(:all) do
Capybara.default_host = 'http://subdomain.lvh.me'
Capybara.app_host = 'http://subdomain.lvh.me'
Capybara.always_include_port = true
end
after(:all) do
Capybara.default_host = 'http://www.example.com'
Capybara.app_host = nil
Capybara.always_include_port = false
end
:
$ nslookup lvh.me
Server: 192.168.100.254
Address: 192.168.100.254#53
Non-authoritative answer:
Name: lvh.me
Address: 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment