如何使用窗帘和康康舞?

问题描述

尝试使用can?方法和存根当前功能

class UserDecorator < Draper::Decorator
  delegate_all

  def some_helper
    can? :read,object
  end
end
RSpec.describe UserDecorator,type: :decorator do
  before { allow(subject).to receive(:current_ability) { Ability.new } }
  subject { User.new.decorate }
  it { subject.some_helper }
end

但是我收到错误消息:user does not implement: current_ability.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)