rspec的更新到3.3.3後,我得到了很多廢棄警告的.. 的should我從改變: describe "visiting the user index" do
before {visit users_path}
scenario{ should have_title('Sign in')}
end
到: describe "visiting the user
基本上,我有一堆共享的例子。我認爲這會工作,但我得到正在傳遞的變量stack level too deep。 shared_examples 'Foo' do
# top level shared example passes values
# to a lower-level shared example.
it_behaves_like 'Bar' do
幫我做這個測試通過: 下面是一些rspec的代碼示例, class User
attr_accessor :count
def initialize
@count = 0
end
# sometimes raises
def danger
puts "IO can be dangerous..."
rescue I
在使用Rspec 3測試Rails 3.0應用程序時,我不斷收到路由錯誤。它無法檢測到我用於獲取請求的路由。下面是我的文件是這樣的: 的routes.rb resources :proficiency_tests do
member do
resource :lag_components, only: [:edit, :update]
end
end
運行耙:路