2013-04-29 12 views
1

일부 rspec 테스트가 있습니다. 나는 RSpec을 실행하면 예를 들어rspec에서 의미가 <top (필수)>입니까?

require 'spec_helper' 

describe UsersController do 

    before (:each) do 
    @user = FactoryGirl.create(:user) 
    sign_in @user 
    end 

    describe "GET 'show'" do 

    it "should be successful" do 
     get :show, :id => @user.id 
     response.should be_success 
    end 

    it "should find the right user" do 
     get :show, :id => @user.id 
     assigns(:user).should == @user 
    end 

    end 

end 

내가 얻을 몇 가지 오류

평균을 수행하고 무엇을 그 RSpec에와 문제가 될 수 무엇
Failures: 

    1) UsersController GET 'show' should be successful 
    Failure/Error: @user = FactoryGirl.create(:user) 
    ActiveRecord::StatementInvalid: 
     SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1 
    # ./spec/controllers/users_controller_spec.rb:6:in `block (2 levels) in <top (required)>' 

    2) UsersController GET 'show' should find the right user 
    Failure/Error: @user = FactoryGirl.create(:user) 
    ActiveRecord::StatementInvalid: 
     SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1 
    # ./spec/controllers/users_controller_spec.rb:6:in `block (2 levels) in <top (required)>' 

rspec ./spec/controllers/users_controller_spec.rb:12 # UsersController GET 'show' should be successful 
rspec ./spec/controllers/users_controller_spec.rb:17 # UsersController GET 'show' should find the right user 

?

+0

이 답변을 확인해보십시오 : http://stackoverflow.com/questions/6330657/what-does-top-required-mean-in-a-ruby-stack-trace – orde

답변

0

호스트는 CentOS5이며 포함 된 SQLite 버전은 이전 버전이며 sqlite3 gem에서는 작동하지 않습니다. 그래서 나는 최신 설치된 sqlite 버전을 사용하도록 bundler를 설정해야했습니다.

bundle config build.sqlite3 \ 
    --with-sqlite3-include=/package/host/localhost/sqlite-3/include \ 
    --with-sqlite3-lib=/package/host/localhost/sqlite-3/lib 

해결 bundle install

문제 하였다.