十一 28
2008年十一月28日,星期五,下午 2:02 | 分类:
RailsNote |
给我留言(1 条留言) |
起因:在未做自己开发rspec的时候,只是调试下安装完 restful_authentication 的rspec和部分test时候,出现了几个错误: 1、 Spec::Mocks::MockExpectationError in ‘SessionsController Logging in by cookie fails cookie login with bad cookie’ fails cookie login with bad cookie(Spec::Rails::Example::ControllerExampleGroup::Subclass_1::Subclass_4) expected :cookies with (any args) once, but received it 0 times ./spec/controllers/authenticated_system_spec.rb:85: 2、 ‘SessionsController Logging in by cookie logs in with cookie’ FAILED expected true, got false ./spec/controllers/authenticated_system_spec.rb:81: 3、 ‘AccessControlTestController requesting xml; [...]
(阅读更多精彩内容...)
十一 28
2008年十一月28日,星期五,上午 8:08 | 分类:
RailsNote |
给我留言 |
一、环境 ruby -v >> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] rails -v >> Rails 2.1.2 二、需要安装的gem和plugin gem install ZenTest 因为我的Rails是2.1.2,所以在安装plugin时,用了下面的方法: ruby script/plugin install git://github.com/dchelimsky/rspec.git ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git ruby script/generate rspec 另外还有一些辅助的工具,不在此详述 三、出现的问题 1、netbeans加载autotest时候的环境变量 解决:在系统环境中,需要加入home=当前项目的根文件夹,这样nb就能正常启用autotest了 2、restful_authentication的rspec时,出现mysql的Mysql::Error: Incorrect datetime value错误 mysql配置文件my.ini中,注释掉 sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION” 一行(我的在87行) 下面添加一行:sql-mode=”" 重启mysql 四:参考文章 RubyTesting The Basics of Creating Rails Plugins,创建Rails插件的基础教程 RSpec的很重要的中文文档: http://www.letrails.cn/archives/20 http://www.letrails.cn/archives/advanced-rspec-tutorials-rspec-scaffold [...]
(阅读更多精彩内容...)