implements test to simulate empty repo

This commit is contained in:
tiagonbotelho 2016-03-02 12:55:01 +00:00 committed by Yorick Peterse
parent d72e6ad2a1
commit 4b3f3167a4

View file

@ -600,5 +600,11 @@ describe Repository, models: true do
it 'shows the main language of the project' do it 'shows the main language of the project' do
expect(repository.main_language).to eq("Ruby") expect(repository.main_language).to eq("Ruby")
end end
it 'returns nil when the repository is empty' do
allow(repository).to receive(:empty?).and_return(true)
expect(repository.main_language).to be_nil
end
end end
end end