File: README

Description

XPath & JavaScript Assertions

(aka YarWiki)

This plugin adds the following test features to a Rails project:

At press time, assert_xpath‘s source is not on RubyForge. Only its documentation is!

To Install

Don‘t use svn:externals: script/plugin install -x

svn:externals is for sharing code between projects within your own shop. Use piston:

   piston import http://phlip.svnrepository.com/svn/yar_wiki/ vendor/plugins/yar_wiki

The AssertJavaScript methods require Javascript::PurePerl. See Javascript::PurePerl for Ruby Enthusiasts to learn to install it.

To Use

Currently used with both Rails 1.1.6 and 1.2.3.

ERGO document

To Test

Add the arts and form_test_helper plugins:

script/plugin install -x form-test-helper.googlecode.com/svn/form_test_helper/ script/plugin install -x thar.be/svn/projects/plugins/arts/

Some Railses also need the assert_select plugin first:

  script/plugin install -x http://labnotes.org/svn/public/ruby/rails_plugins/assert_select

Then hit:

  script/plugin install -x http://phlip.svnrepository.com/svn/yar_wiki/

That gives you assert_xml and assert_xpath, automatically.

If you install Perl and Javascript::PurePerl, you also get assert_javascript. They are not required to activate the Wiki, or to run its private tests.

TO ACTIVATE

Generate a new controller,

  script/generate controller my_wiki

and add this line:

  class MyWikiController < ApplicationController
    include YarWikiActions
  end

Tip: Don‘t write Wiki pages named TestWiki or WikiTestPage. They are reserved for the Wiki‘s private tests.

Tip: YarWiki permits any user to create any Ruby statement. Do not allow untrusted environments (such as the open internet) to access the YarWiki actions.

Then add the file wiki/FrontPage.yaml and put well-formed YAML in it.

TO TEST

Read "Test Driven Ajax", from XXX at O‘Reilly, and install FormTestHelper and ARTS like this:

script/plugin install -x form-test-helper.googlecode.com/svn/form_test_helper/

script/plugin install -x thar.be/svn/projects/plugins/arts/

Then get into the folder vendor/plugins/yar_wiki and enter ‘rake‘