CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 03 Sep 2025 23:23:53 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100807021550
location: https://web.archive.org/web/20100807021550/https://github.com/joshknowles/rspec-on-rails-matchers/
server-timing: captures_list;dur=0.816170, exclusion.robots;dur=0.028003, exclusion.robots.policy;dur=0.012178, esindex;dur=0.013273, cdx.remote;dur=7.572554, LoadShardBlock;dur=174.044184, PetaboxLoader3.datanode;dur=63.940074, PetaboxLoader3.resolve;dur=47.802601
x-app-server: wwwb-app220
x-ts: 302
x-tr: 478
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app220; 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 200
server: nginx
date: Wed, 03 Sep 2025 23:23:54 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Sat, 07 Aug 2010 02:15:50 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "a9801116c0a658edb0d0c3ba603b0571"
x-archive-orig-x-runtime: 68ms
x-archive-orig-content-length: 29440
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 07 Aug 2010 02:15:50 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 29 Jan 2009 12:39:45 GMT", ; rel="prev memento"; datetime="Sat, 12 Jun 2010 15:11:02 GMT", ; rel="memento"; datetime="Sat, 07 Aug 2010 02:15:50 GMT", ; rel="next memento"; datetime="Wed, 18 Jan 2012 19:32:37 GMT", ; rel="last memento"; datetime="Sat, 05 Dec 2020 03:07:06 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_17_20100807000724_crawl103_IndexOnly-c/52_17_20100807021535_crawl101.arc.gz
server-timing: captures_list;dur=0.775140, exclusion.robots;dur=0.028916, exclusion.robots.policy;dur=0.012655, esindex;dur=0.015870, cdx.remote;dur=21.442052, LoadShardBlock;dur=247.969344, PetaboxLoader3.datanode;dur=225.632999, PetaboxLoader3.resolve;dur=246.704560, load_resource;dur=388.419397
x-app-server: wwwb-app220
x-ts: 200
x-tr: 747
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
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
joshknowles's rspec-on-rails-matchers at master - GitHub
joshknowles / rspec-on-rails-matchers
- Source
- Commits
- Network (29)
- Issues (2)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
Sending Request…
A collection of RSpec matchers to be used with the Ruby on Rails project — Read more
commit cfda85023be7b8bc9fd8
tree 02870ab7cae47bd8496e
parent 89e73dc828d96b960b03 parent 4e88e05cfcf4ef79103b
tree 02870ab7cae47bd8496e
parent 89e73dc828d96b960b03 parent 4e88e05cfcf4ef79103b
name | age | message | |
---|---|---|---|
![]() |
CHANGELOG | Sun Mar 02 21:22:23 -0800 2008 | Added have_form_putting_to. [joshknowles] |
![]() |
MIT-LICENSE | Wed Jan 02 22:50:07 -0800 2008 | Updated Readme to reflect contributions from Br... [joshknowles] |
![]() |
README | Sun Mar 02 21:22:23 -0800 2008 | Added have_form_putting_to. [joshknowles] |
![]() |
TODO | Sun Mar 02 20:53:53 -0800 2008 | Updated readme to remove google code specific l... [joshknowles] |
![]() |
init.rb | Sun Mar 02 21:14:47 -0800 2008 | Added should observe. Patch by Luke Melia. [joshknowles] |
![]() |
lib/ | Sun Mar 02 21:22:23 -0800 2008 | Added have_form_putting_to. [joshknowles] |
README
rspec-on-rails-matchers ======================= Setup ------ Dependencies: ------------- * rspec * rspec_on_rails Overview -------- Adds the following RSpec matchers: * Associations: Verify that the association has been defined. (doesn't verify that the association works!) object.should have_many(:association) example: @post.should have_many(:comments) TM snippet: [mshm + tab] (Model Should Have Many) object.should belong_to(:association) example: @comment.should belong_to(:post) TM snippet: [msbt + tab] object.should have_one(:association) user.should have_one(:social_security_number) TM snippet: [msho + tab] object.should have_and_belong_to_many(:association) project.should have_and_belong_to_many(:categories) TM snippet: [mshabtm + tab] * Validations: Verify that a validation has been defined. (doesn't test the validation itself) object.should validate_presence_of(:attribute) TM snippet: [msvp + tab] object.should validate_confirmation_of(:attribute) TM snippet: [msvc + tab] object.should validate_uniqueness_of(:attribute) TM snippet: [msvu + tab] object.should validate_length_of(:attribute, :within => 5..10) object.should validate_length_of(:attribute, :is => 5) TM snippet: [msvl + tab] * Observers: Verify that the observer is observing a class. (doesn't verify that the observation works) object.should observe(:model) example: GroupObserver.should observe(Group) * Views: Verifies that the views contains some tags. response.should have_form_posting_to(url_or_path) TM snippet: [hfpt + tab] response.should have_form_putting_to(url_or_path) response.should have_text_field_for(:attribute) TM snippet: [htff + tab] response.should have_label_for(:attribute) TM snippet: [hlf + tab] response.should have_password_field_for(:attribute) TM snippet: [hpff + tab] response.should have_checkbox_for(:attribute) TM snippet: [hcf + tab] response.should have_submit_button TM snippet: [hsb + tab] response.should have_link_to(url_or_path, "optional_text") TM snippet: [hlt + tab] * nested view tests: for instance: response.should have_form_posting_to(url_or_path) do with_text_field_for(:attribute) end with_text_field_for(:attribute) TM snippet: [wtff + tab] with_label_for(:attribute) TM snippet: [wlf + tab] with_password_field_for(:attribute) TM snippet: [wpff + tab] with_checkbox_for(:attribute) TM snippet: [wcf + tab] with_submit_button TM snippet: [wsb + tab] with_link_to(url_or_path, "optional_text") TM snippet: [wlt + tab] Usage: ------ In your view spec: it "should render new form" do render "/users/new.html.erb" response.should have_form_posting_to(users_path) do with_text_field_for(:user_name) with_text_area_for(:user_address) with_text_field_for(:user_login) with_text_field_for(:user_email) with_submit_button end end In your model spec: describe User do before(:each) do @user = User.new end it "should have many posts" do @user.should have_many(:posts) end it "should belong to a group" do @user.should belong_to(:group) end it do @user.should validate_presence_of(:email) end it do @user.should validate_uniqueness_of(:email) end it do @user.should validate_uniqueness_of(:login) end it do @user.should validate_presence_of(:login) end it do @user.should validate_presence_of(:name) end it do @user.should validate_length_of(:password, :between => 4..40) end it do @user.should validate_confirmation_of(:password) end end Core Contributors ----------------- * Josh Knowles <joshknowles@gmail.com> * Bryan Helmkamp <bryan@brynary.com> * Matt Aimonetti <mattaimonetti@gmail.com> Contributors ------------- * ckknight * Matt Pelletier * Luke Melia Copyright (c) 2008 The Plugin Development Team, released under the MIT license