end
end
context 'つつがなく終わるとき' do
- it '空っぽの配列を返す' do
+ it 'ImportResultを返す' do
r = ProviderLicense.import @provider.id, [@license.attributes]
- r.should be_empty
+ r.is_a?(ImportResult).should be_true
+ r.should be_success
end
it '対照表が追加される' do
lambda {
end
end
context '複数インポートのとき' do
- it '空っぽの配列を返す' do
+ it 'ImportResultを返す' do
r = ProviderLicense.import @provider.id, [@license.attributes, @license2.attributes]
- r.should be_empty
+ r.is_a?(ImportResult).should be_true
+ r.should be_success
end
it '対照表が追加される' do
lambda {
before do
ProviderLicense.any_instance.stub(:save).with(any_args).and_return(false)
end
- it 'çµ\90æ\9e\9cã\81«è²¸æ\89\8bå\81´ã\83©ã\82¤ã\82»ã\83³ã\82¹ã\81®ã\82«ã\83©ã\83 å\80¤ã\82\92追å\8a している' do
+ it 'çµ\90æ\9e\9cã\81\8c失æ\95\97している' do
r = ProviderLicense.import @provider.id, [@license.attributes]
- r.should_not be_empty
+ r.should_not be_success
+ r.failures.should_not be_empty
end
end
context 'ライセンスの管理名取得に失敗したとき' do
before do
License.stub(:find_by_name).with(any_args).and_return(nil)
end
- it 'çµ\90æ\9e\9cã\81«è²¸æ\89\8bå\81´ã\83©ã\82¤ã\82»ã\83³ã\82¹ã\81®ã\82«ã\83©ã\83 å\80¤ã\82\92追å\8a している' do
+ it 'çµ\90æ\9e\9cã\81\8c失æ\95\97している' do
r = ProviderLicense.import @provider.id, [@license.attributes]
- r.should_not be_empty
+ r.should_not be_success
+ r.failures.should_not be_empty
end
end
end