首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Rails:如何测试控制器的私有方法?

Rails:如何测试控制器的私有方法?
EN

Stack Overflow用户
提问于 2010-11-25 05:26:51
回答 9查看 59.9K关注 0票数 126

我有控制器:

class AccountController < ApplicationController
  def index
  end

  private
  def current_account
    @current_account ||= current_user.account
  end
end

如何使用rspec测试私有方法current_account

附言:我使用Rspec2和Ruby on Rails 3

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4271696

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档