简体   繁体   中英

Mocking view helpers with rspec-rails 2.0.0.beta.8

I am trying to mock a view helper with rspec2. The old way of doing this throws an error, complaining the template object is not defined:

template.should_receive(:current_user).and_return(mock("user"))

Am I missing something here, or is this not implemented in rspec2 (yet)?

弄清楚自己:

view.should_receive(:current_user).and_return(mock("user"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM