Add framework for system tests

This commit is contained in:
Tom Hughes 2017-10-29 20:58:23 +00:00
parent aa1fb6dbb8
commit 9e929de530
6 changed files with 30 additions and 2 deletions

View file

@ -0,0 +1,14 @@
require "test_helper"
require "capybara/poltergeist"
WebMock.disable_net_connect!(:allow_localhost => true)
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :poltergeist, :screen_size => [1400, 1400]
def initialize(*args)
stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
.to_return(:status => 404)
super(*args)
end
end

9
test/system/site_test.rb Normal file
View file

@ -0,0 +1,9 @@
require "application_system_test_case"
class SiteTest < ApplicationSystemTestCase
test "visiting the index" do
visit "/"
assert_selector "h1", :text => "OpenStreetMap"
end
end