开发者

rspec + remarkable + before_filter

开发者 https://www.devze.com 2022-12-28 11:07 出处:网络
How do I test before_filter with rspec and remarkable. With only rspec I would do somethi开发者_如何学编程ng like:

How do I test before_filter with rspec and remarkable. With only rspec I would do somethi开发者_如何学编程ng like:

 controller.stub(:logged_in?).and_return(true)

But with remarkable this results in:

undefined local variable or method `controller' for #<Class:0x7f8f056ef3c0> (NameError)


expects :logged_in?, :on => proc { @controller }, :returns => true 

(solution found here)

0

精彩评论

暂无评论...
验证码 换一张
取 消