CARVIEW |
- Source
- Commits
- Network
- Pull Requests (0)
- Issues (10)
- Wiki (1)
- Graphs
-
Tag:
v2.0.0.a10
click here to add a description
click here to add a homepage
- Switch Branches (4)
-
Switch Tags (37)
- v2.0.1
- v2.0.0.rc
- v2.0.0.beta.22
- v2.0.0.beta.21
- v2.0.0.beta.20
- v2.0.0.beta.19
- v2.0.0.beta.18
- v2.0.0.beta.17
- v2.0.0.beta.16
- v2.0.0.beta.15
- v2.0.0.beta.14.2
- v2.0.0.beta.14.1
- v2.0.0.beta.14
- v2.0.0.beta.13
- v2.0.0.beta.12
- v2.0.0.beta.11
- v2.0.0.beta.10
- v2.0.0.beta.9.1
- v2.0.0.beta.9
- v2.0.0.beta.8
- v2.0.0.beta.7
- v2.0.0.beta.6
- v2.0.0.beta.5
- v2.0.0.beta.4
- v2.0.0.beta.3
- v2.0.0.beta.2
- v2.0.0.beta.1
- v2.0.0.a10
- v2.0.0.a9
- v2.0.0.a8
- v2.0.0.a7
- v2.0.0.a6
- v2.0.0.a5
- v2.0.0.a4
- v2.0.0
- 2.0.0.a3
- 2.0.0.a2
- Branch List
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Loading commit data... ![]() |
|
![]() |
README.markdown | ||
![]() |
Rakefile | ||
![]() |
VERSION | ||
![]() |
example_app_template.rb | ||
![]() |
lib/ | ||
![]() |
templates/ |
RSpec-2 for Rails-3
Backwards compatibility
None. This is a rewrite of the rspec-rails extension designed to work with rails-3.x and rspec-2.x. It will not work with older versions of either rspec or rails.
Current state
Currently in alpha - some things work, some not so much - see Known Issues, below
Install:
gem install rspec-rails --pre
This installs the following gems:
- rspec
- rspec-core
- rspec-expectations
- rspec-mocks
- rspec-rails
Configure:
Add this line to the Gemfile:
gem "rspec-rails", ">= 2.0.0.a9"
This will expose generators, including rspec:install. Now you can run:
script/rails g rspec:install
This adds the spec directory and some skeleton files, including the "rake spec" task.
Note that things are in flux, so some generators generate code that doesn't work all that well yet.
What works (and what doesn't)
Currently supported:
- each example runs in its own transaction
- not yet configurable
- i.e. no way to turn this off
- not yet configurable
- model specs in spec/models
- controller specs in spec/controllers
- no view isolation yet
- view specs in spec/views
- mailer specs in spec/mailers
- observer specs in spec/models
- request specs in spec/requests
- these wrap rails integration tests
- rails assertions
- assertion-wrapping matchers
- redirect_to
- render_template
- template must exist (unlike rspec-rails-1.x)
- webrat matchers
- generators
- run "script/rails g" to see the list of available generators
Known issues
- no helper specs
- no routing specs
- only works with ActiveRecord
Controller Specs
Controller specs live in spec/controllers, and include behavior from ActionDispatch::Integration::Runner. The format for a request is:
# get action, params, headers
get :show, {:id => '37'}, {'HTTP_ACCEPT' => Mime::JS}
This works for get
, post
, put
, delete
, head
.
After a request is made, you set expectations on the request
and response
objects.
- © 2010 GitHub Inc. All rights reserved.
- Terms of Service
- Privacy
- Security
Keyboard Shortcuts
Site wide shortcuts
- s
- Focus site search
- ?
- Bring up this help dialog
Commit list
- j
- Move selected down
- k
- Move selected up
- t
- Open tree
- p
- Open parent
- c or o or enter
- Open commit
Pull request list
- j
- Move selected down
- k
- Move selected up
- o or enter
- Open issue
Issues
- j
- Move selected down
- k
- Move selected up
- x
- Toggle select target
- o or enter
- Open issue
- I
- Mark selected as read
- U
- Mark selected as unread
- e
- Close selected
- y
- Remove selected from view
- c
- Create issue
- l
- Create label
- i
- Back to inbox
- u
- Back to issues
- /
- Focus issues search
Network Graph
- ← or h
- Scroll left
- → or l
- Scroll right
- ↑ or k
- Scroll up
- ↓ or j
- Scroll down
- t
- Toggle visibility of head labels
- shift ← or shift h
- Scroll all the way left
- shift → or shift l
- Scroll all the way right
- shift ↑ or shift k
- Scroll all the way up
- shift ↓ or shift j
- Scroll all the way down