花费 10ms 找到2011条记录
How can I test update_attributes function in Rails with RSpec? 繁体
2017年10月29 - In my Rails 4 app I have this update action: 在我的Rails 4应用程序中,我有此更新操作: class UsersController < ApplicationController ... def update curre

ActionController::UrlGenerationError: No route matches {:action=>“index”, :controller=>“educations”} 繁体
2017年06月19 - I am running tests, on a controller spec/controllers/educations_controller_spec.rb, with RSpec. 我正在使用RSpec在控制器spec / controllers / educations_control

RSpec: how to test if a method was called? 繁体
2014年01月21 - When writing RSpec tests, I find myself writing a lot of code that looks like this in order to ensure that a method was called during the execution of

mocking an error/exception in rspec (not just its type) 繁体
2010年01月14 - I have a block of code like this: 我有一个像这样的代码块: def some_method begin do_some_stuff rescue WWW::Mechanize::ResponseCodeError => e if e.

Using rails' “post” in controller tests in rspec with scoping and protocol on routes 繁体
2013年04月09 - I have a rails project that is running out of a subdirectory of the base url in production and I want it to act that way in dev so as to make dev and

I'm getting NoMethodError: undefined method `user' when I run an RSpec test on one of my methods 繁体
2014年11月27 - I'm new to programming, and have been learning Ruby on Rails for about 10 weeks now. 我是编程新手,现在已经学习Ruby on Rails大约10周了。 When I run an rspec test on t

How do instance variables in rspec work? 繁体
2012年09月28 - Here is a bit of code from M Hartl's Ruby on Rails Tutorial. Can anyone explain why an instance variable (@user) is necessary and why not use a local

how do I test that an instance variable is set in my my mailer with rspec? 繁体
2014年01月12 - How do I test that a certain instance variable is set in my my mailer with rspec? assigns is coming back undefined.. 如何使用rspec测试我的邮件程序中是否设置了某个实例变量?分配回

RSpec: difference between “should == …” and “should eql(…)” 繁体
2010年07月19 - In RSpec, what's the difference between using should == ... and should eql(...)? I noticed that the RSpec documentation always uses eql, but == is les

Is there a simple way to get the first argument passed to Rspec's `describe`? 繁体
2012年11月21 - Suppose I have a test suite where I start by giving describe a constant: 假设我有一个测试套件,我以描述一个常数开始: describe SomeExcessivelyLong::And::Maybe::Namespaced:


 
粤ICP备14056181号  © 2014-2021 ITdaan.com