1
我剛剛開始使用rspec,我使用expect
而不是should
約定。如何將「should」轉換爲「expect」約定?
我怎樣才能改變從康康舞從should
到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