CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 23 Jul 2025 18:44:41 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090104024632
location: https://web.archive.org/web/20090104024632/https://github.com/github/test_spec_on_rails/tree
server-timing: captures_list;dur=0.615873, exclusion.robots;dur=0.019392, exclusion.robots.policy;dur=0.007476, esindex;dur=0.008275, cdx.remote;dur=42.245999, LoadShardBlock;dur=432.749238, PetaboxLoader3.datanode;dur=130.174789, PetaboxLoader3.resolve;dur=98.480520
x-app-server: wwwb-app239
x-ts: 302
x-tr: 563
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: SERVER=wwwb-app239; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Wed, 23 Jul 2025 18:44:43 GMT
content-type: text/html; charset=utf-8
content-length: 121
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 04 Jan 2009 02:46:30 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7BzoOcmV0dXJuX3RvIhYvdGZseW5uL2ZvbGxvd2VycyIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--09068985f3217c6c76950cbf2d0d127db0588722; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090104024632/https://github.com/github/test_spec_on_rails/tree/master
x-archive-orig-x-runtime: 235ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 121
cache-control: max-age=1800
memento-datetime: Sun, 04 Jan 2009 02:46:32 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 04 Jul 2008 20:01:50 GMT", ; rel="prev memento"; datetime="Fri, 04 Jul 2008 20:01:50 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 02:46:32 GMT", ; rel="last memento"; datetime="Sun, 04 Jan 2009 02:46:32 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090103234219_crawl108-c/52_7_20090104023629_crawl103.arc.gz
server-timing: captures_list;dur=0.701933, exclusion.robots;dur=0.020168, exclusion.robots.policy;dur=0.007836, esindex;dur=0.011972, cdx.remote;dur=26.907287, LoadShardBlock;dur=561.273251, PetaboxLoader3.datanode;dur=347.102785, PetaboxLoader3.resolve;dur=473.657600, load_resource;dur=321.115672
x-app-server: wwwb-app239
x-ts: 301
x-tr: 949
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 23 Jul 2025 18:44:43 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 04 Jan 2009 02:46:32 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoOcmV0dXJuX3RvIhYvdGZseW5uL2ZvbGxvd2Vycw%3D%3D--68ee61a8a7e96915836221296cafb2f768b5b154; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 1689ms
x-archive-orig-etag: "670988f029194b567e23c1794cc46395"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 19626
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 04 Jan 2009 02:46:32 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 10 Oct 2008 18:04:11 GMT", ; rel="prev memento"; datetime="Fri, 10 Oct 2008 18:04:11 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 02:46:32 GMT", ; rel="next memento"; datetime="Mon, 05 Jan 2009 07:35:43 GMT", ; rel="last memento"; datetime="Mon, 05 Jan 2009 07:35:43 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090103234219_crawl108-c/52_7_20090104023629_crawl103.arc.gz
server-timing: captures_list;dur=0.596671, exclusion.robots;dur=0.018783, exclusion.robots.policy;dur=0.007754, esindex;dur=0.009589, cdx.remote;dur=27.901107, LoadShardBlock;dur=236.831711, PetaboxLoader3.datanode;dur=144.620233, PetaboxLoader3.resolve;dur=247.995657, load_resource;dur=209.751274
x-app-server: wwwb-app239
x-ts: 200
x-tr: 548
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=7
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
github's test_spec_on_rails at master — GitHub
We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]
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 (

Fork of pelargir/test_spec_on_rails | |
Description: | Rails plugin with helpers to test your app using test/spec. |
Homepage: | https://agilewebdevelopment.com/plugins/test_spec_on_rails |
Clone URL: |
git://github.com/github/test_spec_on_rails.git
Give this clone URL to anyone.
git clone git://github.com/github/test_spec_on_rails.git
|

Matthew Bass (author)
Thu May 08 14:16:05 -0700 2008
name | age | message | |
---|---|---|---|
![]() |
CHANGELOG | Wed Apr 02 18:40:14 -0700 2008 | initial import [Matthew Bass] |
![]() |
LICENSE | Wed Apr 02 18:40:14 -0700 2008 | initial import [Matthew Bass] |
![]() |
README | Thu May 08 14:16:05 -0700 2008 | updated README [Matthew Bass] |
![]() |
Rakefile | Wed Apr 02 18:40:14 -0700 2008 | initial import [Matthew Bass] |
![]() |
lib/ | Wed Apr 02 18:40:14 -0700 2008 | initial import [Matthew Bass] |
![]() |
test/ | Wed Apr 02 18:40:14 -0700 2008 | initial import [Matthew Bass] |
README
test/spec/rails This plugin contain some helpers to test your Rails app using test/spec. Installation ------------ * Install test/spec: gem install test-spec * Install test/spec/rails * require 'test/spec/rails' in your test_helper.rb Source ------ test/spec/rails uses Git for source control. If you're running edge Rails, you can install with: script/plugin install git://github.com/pelargir/test_spec_on_rails.git Otherwise, I recommend using the git-rails gem: sudo gem install git-rails git-rails install git://github.com/pelargir/test_spec_on_rails.git test_spec_on_rails Model validation ---------------- @user.should.validate @user.should.not.validate or: @user.should.be.validated @user.should.not.be.validated Redirection ----------- response.should.be.redirected # assert_response :redirect response.should.redirect foo_url(@foo) # assert_redirected_to foo_url(@foo) should.redirect_to :action => 'show' # because "response" is optional It's aliased as redirect, redirect_to, redirected and redirected_to Output verification ------------------- Wrapper for assert_select: get :show page.should.select "form#user_form" # require the output to have a <form id="user_form"> page.should.select "form#user_form" do |form| form.should.select "input[type=submit]" # the user_form must include a <input type="submit"> end HTTP Status ----------- Wrapper for assert_response: status.should.be :success status.should.be 200 Which template was rendered? ---------------------------- Wrapper for assert_template: template.should.be "foo/show.rhtml" Which layout used? ------------------ Wrapper for asserting that a certain layout is used: layout.should.be "foo" URL testing ----------- get :show, :user_id => 1 url.should.be "/users/1" url.should.be :controller => "users", :action => "show", :user_id => 1 Difference ---------- Wrapper for assert_difference: Article.should.differ(:count).by(2) { blah } Routing to set of url options from a given path (i.e., #assert_generates) ------------------------------------------------------------------------- assert_generates "/users/1", :controller => "users", :action => "show", :id => "1" becomes {:controller => "users", :action => "show", :id => "1"}.should.route_to "/users/1" Routing from a set of url options to an expected path (i.e., #assert_recognizes) -------------------------------------------------------------------------------- assert_recognizes({:controller => "users", :action => "show", :id => "1"}, {:path => "/users/1", :method => :get}) becomes {:path => "/users/1", :method => :get}.should.route_from :controller => "users", :action => "show", :id =>"1" Setup controller for testing + example usage -------------------------------------------- context "A guest" do use_controller FooController specify "isn't allowed to foo" do post :create, :foo => 'bar' flash[:error].should.not.be.blank response.should.redirect :controller => 'front', :action => 'show' assigns(:foo).errors.on(:bar).should.not.be.blank assigns(:foo).should.not.validate follow_redirect page.should.select "#errors", :text => /#{flash[:error]}/ end end context "Tuxie" do setup do use_controller FooController login_as :tuxie end specify "may foo" do post :create, :foo => 'bar' flash[:notice].should.not.be.blank assigns(:foo).errors.should.be.empty assigns(:foo).should.validate should.redirect_to :action => 'show' follow_redirect page.should.select "#notice", :text => /#{flash[:notice]}/ end end Misc ---- page, response and request are just aliases for self (the TestCase) so the following are functionally identical: page.should.redirect response.should.redirect request.should.redirect output, body, html and xhtml return @response.body so the following lines are identical: output.should.match /foo/ html.should.match /foo/ xhtml.should.match /foo/ body.should.match /foo/ If an object respond to #should_equal, that method will be used instead of assert_equal when using foo.should.equal(bar) or foo.should.be(bar) foo.should.not.equal and foo.should.not.be look for #should_not_equal Credit ------ * Created by Per "Tuxie" Wigren <per.wigren@gmail.com> * Enhanced by Rick Olson <technoweenie@gmail.com> * Currently maintained by Matthew Bass <pelargir@gmail.com>
This feature is coming soon. Sit tight!