Created
April 2, 2013 15:52
-
-
Save machty/5293315 to your computer and use it in GitHub Desktop.
capybara + minitest + serve-this
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 '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