Last active
August 3, 2017 09:52
-
-
Save oakbow/6ed8a5893fd30eb0bfda2fe2ae383d91 to your computer and use it in GitHub Desktop.
feature spec toward subdomain ref: http://qiita.com/Oakbow/items/3da1b20ff17e5e192f47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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