[rspec-users] Specifying views

David Chelimsky dchelimsky at gmail.com
Fri Nov 10 17:28:58 EST 2006


What version of zentest do you have?

On 11/10/06, Brandon Keepers <brandon at collectiveidea.com> wrote:
> 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/
> new_view_spec.rb:
>
> 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'}
>    end
> end
>
> and when I run that, I get:
>
> 1)
> 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.
> /Users/brandon/projects/finances/config/../vendor/rails/actionpack/
> lib/action_controller/base.rb:1049:in `assign_deprecated_shortcuts'
> /Users/brandon/projects/finances/config/../vendor/rails/actionpack/
> lib/action_controller/base.rb:1044:in `assign_deprecated_shortcuts'
> /Users/brandon/projects/finances/config/../vendor/rails/actionpack/
> lib/action_controller/base.rb:1035:in `assign_shortcuts_without_flash'
> /Users/brandon/projects/finances/config/../vendor/rails/actionpack/
> 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?
>
> Thanks,
> Brandon
>
>
> [1] http://rspec.rubyforge.org/documentation/rails/writing/views.html
> [2] http://blog.davidchelimsky.net/articles/2006/11/06/view-spec-
> tutorial
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
>


More information about the rspec-users mailing list