Created
December 7, 2011 15:13
-
-
Save jescalante/1443155 to your computer and use it in GitHub Desktop.
Capybara relative links
This file contains 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
# 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