[rspec-users] Specifying views

Brandon Keepers brandon at collectiveidea.com
Fri Nov 10 15:14:47 EST 2006

I'm trying to spec my views with 0.7.1 on edge rails  per the  
instructions on the rspec site [1] and David's blog [2], but I'm not  
having much luck.  Here's my spec in specs/views/accounts/ 

require File.dirname(__FILE__) + '/../../spec_helper'

context "The new account form" do

   specify "should have an account name" do
     render 'accounts/new'
     response.should_have_tag 'input', :attributes => {:name =>  
'account[name]', :type => 'text'}

and when I run that, I get:

RuntimeError in 'The new account form should have an account name'
Deprecating @session, but it's already set to  
#<ActionController::TestSession:0x3c46870 @attributes={"flash"=>{}}>!  
Use the session= writer method instead of setting @session directly.
lib/action_controller/base.rb:1049:in `assign_deprecated_shortcuts'
lib/action_controller/base.rb:1044:in `assign_deprecated_shortcuts'
lib/action_controller/base.rb:1035:in `assign_shortcuts_without_flash'
lib/action_controller/flash.rb:140:in `assign_shortcuts'

I can't even tell what the error is.  It's giving a RuntimeError, but  
for what?  The deprecation warning? Anyone see anything obvious?


[1] http://rspec.rubyforge.org/documentation/rails/writing/views.html
[2] http://blog.davidchelimsky.net/articles/2006/11/06/view-spec- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/rspec-users/attachments/20061110/c9da7b1b/attachment.bin 

More information about the rspec-users mailing list