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
-------------- 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
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 > > >
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? >The obvious answer is that we haven''t tested spec/rails agains edge rails - only 1.1.6 It''s on our TODO list Aslak> 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 > > >
On Nov 10, 2006, at 5:28 PM, David Chelimsky wrote:> What version of zentest do you have?$ gem list ZenTest *** LOCAL GEMS *** ZenTest (3.4.1, 3.4.0) ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.