Skip to content

Instantly share code, notes, and snippets.

@jescalante
Created December 7, 2011 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jescalante/1443155 to your computer and use it in GitHub Desktop.
Save jescalante/1443155 to your computer and use it in GitHub Desktop.
Capybara relative links
# test_helper.rb
...
require 'capybara/rails'
require 'minitest/autorun'
Capybara.configure do |config|
config.run_server = true
config.server_port = 9887
config.app_host = 'http://www.example.com:9887'
end
class RequestSpec < MiniTest::Spec
include Capybara::DSL
end
# integration/example_test.rb
require 'test_helper'
class ExampleTest < RequestSpec
describe 'First Test' do
it 'should render home'
visit('/')
click_link('Item')
assert page.has_content?('Items')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment