51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 5509|回复: 4
打印 上一主题 下一主题

[原创] rspec测试问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2015-3-5 11:40:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
rails rspec测试问题,之前运行测试并没有这个错误,不知道是不是升级了某些东西导致的。
测试本身并没有用到数据库,测试也没有用到报错里的例子。
现在所有的测试都引起这个问题,比如简单的:
require 'spec_helper'

describe 'some_thing' do

  it "returns the product price" do
    #expect(helper.product_price).to eq(100)
  end
end


哪位高手知道是哪里的问题?
Failure/Error: Unable to find matching line from backtrace
     ActiveRecord::ConnectionNotEstablished:
       ActiveRecord::ConnectionNotEstablished
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/connection_handling.rb:87:in `connection'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/fixtures.rb:499:in `create_fixtures'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/fixtures.rb:984:in `load_fixtures'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/fixtures.rb:957:in `setup_fixtures'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activerecord-4.1.8/lib/active_record/fixtures.rb:806:in `before_setup'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-rails-3.2.0/lib/rspec/rails/adapters.rb:110:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:333:in `instance_exec'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:333:in `instance_exec'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:387:in `execute_with'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:616:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:247:in `call'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:247:in `call'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:617:in `run_around_example_hooks_for'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:474:in `run'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:343:in `with_around_example_hooks'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:385:in `with_around_and_singleton_context_hooks'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example.rb:174:in `run'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:548:in `block in run_examples'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:544:in `map'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:544:in `run_examples'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:512:in `run'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:110:in `block (3 levels) in run_specs'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:110:in `map'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:110:in `block (2 levels) in run_specs'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1526:in `with_suite_hooks'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:109:in `block in run_specs'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/reporter.rb:62:in `report'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:108:in `run_specs'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:86:in `run'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:70:in `run'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:38:in `invoke'
     # /Users/user_name/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.0/exe/rspec:4:in `<top (required)>'
     # /Users/user_name/.rbenv/versions/2.1.5/bin/rspec:23:in `load'
     # /Users/user_name/.rbenv/versions/2.1.5/bin/rspec:23:in `<main>'
     #
     #   Showing full backtrace because every line was filtered out.
     #   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
     #   RSpec::Configuration#backtrace_inclusion_patterns for more information.

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2015-3-10 12:07:57 | 只看该作者
楼上在干嘛?
回复 支持 反对

使用道具 举报

  • TA的每日心情
    无聊
    2015-6-29 10:39
  • 签到天数: 7 天

    连续签到: 1 天

    [LV.3]测试连长

    4#
    发表于 2015-6-11 11:02:15 | 只看该作者
    上爱内测(www.detect.cn)去做一个检测吧,这样会方便很多
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-11 15:51 , Processed in 0.068203 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表