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
1 changed files with 6 additions and 0 deletions

View File

@ -600,5 +600,11 @@ describe Repository, models: true do
it 'shows the main language of the project' do
expect(repository.main_language).to eq("Ruby")
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