2017-02-17 76 views
0

此代码出现在我的两个规格的:如何避免测试重复?

it 'does not add the reply' do 
    expect { subject }.not_to change { replies.length } 
end 

it 'does not publish the event' do 
    expect { subject }.not_to publish_event(:reply_event) 
end 

我应该怎么写我的规格,以避免这种重复?

回答