1

rspec を使い始めたばかりで、規約expectの代わりに使用していますshould

shouldこのテスト例を CanCan からに変換するにはどうすればよいexpectですか?:

require "cancan/matchers"
# ...
describe "User" do
  describe "abilities" do
    subject { ability }
    let(:ability){ Ability.new(user) }
    let(:user){ nil }

    context "when is an account manager" do
      let(:user){ Factory(:accounts_manager) }

      it{ should be_able_to(:manage, Account.new) }
    end
  end
end
4

1 に答える 1