diff options
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index b0ec725bf70..88442247093 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -102,6 +102,22 @@ describe Project do end end + context 'Site Statistics' do + context 'when creating a new project' do + it 'tracks project in SiteStatistic' do + expect { create(:project) }.to change { SiteStatistic.fetch.repositories_count }.by(1) + end + end + + context 'when deleting a project' do + it 'untracks project in SiteStatistic' do + project = create(:project) + + expect { project.destroy }.to change { SiteStatistic.fetch.repositories_count }.by(-1) + end + end + end + context 'updating cd_cd_settings' do it 'does not raise an error' do project = create(:project) |