Skip to content

Instantly share code, notes, and snippets.

@machty
Created April 2, 2013 15:52
Show Gist options
  • Select an option

  • Save machty/5293315 to your computer and use it in GitHub Desktop.

Select an option

Save machty/5293315 to your computer and use it in GitHub Desktop.
capybara + minitest + serve-this
require 'minitest/autorun'
require_relative './spec_helper'
require 'capybara_minitest_spec'
require 'serve-this'
MiniTest::Spec.class_eval do
include Capybara::DSL
end
Capybara.app = ServeThis.from(File.join(Dir.pwd, 'spec', 'sample_template'))
describe "test.html" do
def visit_test_page!
# NOTE: serve-this must be running in
# spec/sample_template directory
visit 'http://localhost:1337/test.html'
end
it "is accessible" do
visit_test_page!
page.must_have_content 'Hello'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment