describe '#messages' do
subject do
FactoryGirl.create :foo,
:type => 'test',
:country => 'US'
end
context 'when is not U.S.' do
before{ allow(subject).to receive(:country).and_return('MX') }
describe '#messages' do
subject { super().messages }
it { is_expected.to include 'This foo was not issued in the United States of America.' }
end
end
end
我想分配一個屬性的主題......我似乎無法得到咒語正確。我需要一個Double嗎?我不確定這是如何工作的,而且我顯然無法破譯文檔。任何幫助表示讚賞。RSpec 3未定義的方法`允許'爲#<RSpec :: Core :: ExampleGroup ...>