This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Matthew Bass (author)
Fri Aug 07 06:50:08 -0700 2009
commit 2558ffc3a0cdc4a427aa20b72c40ff3b69d0f403
tree 4375e4344a9da3fb19567bd822da3489da342a83
parent 26d01fd85b1a9d96de7cf28ab0929746c382d6a9
tree 4375e4344a9da3fb19567bd822da3489da342a83
parent 26d01fd85b1a9d96de7cf28ab0929746c382d6a9
lindo /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Jun 29 10:44:01 -0700 2009 | |
| |
CHANGELOG | Mon Jun 29 10:44:01 -0700 2009 | |
| |
MIT-LICENSE | Mon Jun 29 10:44:01 -0700 2009 | |
| |
README | Mon Jun 29 10:44:01 -0700 2009 | |
| |
Rakefile | Mon Jun 29 10:44:01 -0700 2009 | |
| |
lib/ | Fri Aug 07 06:50:08 -0700 2009 | |
| |
lindo.gemspec | Tue Jun 30 08:50:17 -0700 2009 | |
| |
test/ | Tue Jun 30 07:18:29 -0700 2009 |
README
= lindo
Enables rendering of the body of an HTTP response from inside controller and
integration tests. This makes it easy to diagnose problems when building
assert_select statements or just sanity check the output of the test.
== Installation
Install the gem directly:
sudo gem install adeptware-lindo --source=http://gems.github.com
Or install the gem in your Rails project:
script/plugin install git://github.com/adeptware/lindo.git
Then require lindo in your test_helper.rb or spec_helper.rb file:
require 'lindo'
You may also have to extend the Lindo module from your test or spec
helper if you use sessions in your integration tests:
session.extend Lindo
== Usage
Insert the vr method in your functional test immediately after an HTTP
request has been sent:
def test_new
post :new
vr
assert_select "div[id=header]"
end
vr attempts to open the response body in the default web browser. If you want
to open the raw HTML in the default text editor instead, simply pass the :html
symbol to the method:
def test_new
post :new
vr(:html)
...
end
By default, vr looks for an instance variable named @response and calls the #body
method on it. If your page body is stored in a different variable, such as when
testing a mailer, you can pass the raw HTML directly to vr and it will do the
right thing:
def test_mailer
mail = Mailer.create_notification
vr(mail.body)
...
end
Note that to use the default web view, your Rails application must be running
locally on port 3000. This will ensure that the page renders correctly with the
appropriate images and stylesheets. The server doesn't need to be running if
you use the HTML-only view.
== Compatibility
lindo requires OS X. Support for Windows is planned.
test/spec and test/unit work fine with lindo. RSpec, however, tests views
independently of controllers, so lindo won't work with it.
== Running Unit Tests
Use the rake command to run the unit tests for the plugin. The tests require
that the Mocha gem be installed locally:
sudo gem install mocha
== Resources
Repository: http://github.com/adeptware/lindo/
Blog: http://adeptware.com/blog
Author: Adeptware, Inc.








