diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 18:09:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 18:09:37 +0300 |
commit | 2c89e169769ead722394a79ed67fcd08e96863dd (patch) | |
tree | 0dadb576846c484475b895f75fab41f71cdb952e /spec/models/project_spec.rb | |
parent | bd497e352ebd279536ae11855871162e82a3f88c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index f847cb63ddc..9dc362594dd 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3901,7 +3901,7 @@ describe Project do end context 'legacy storage' do - set(:project) { create(:project, :repository, :legacy_storage) } + let_it_be(:project) { create(:project, :repository, :legacy_storage) } let(:gitlab_shell) { Gitlab::Shell.new } let(:project_storage) { project.send(:storage) } @@ -4000,7 +4000,7 @@ describe Project do end context 'hashed storage' do - set(:project) { create(:project, :repository, skip_disk_validation: true) } + let_it_be(:project) { create(:project, :repository, skip_disk_validation: true) } let(:gitlab_shell) { Gitlab::Shell.new } let(:hash) { Digest::SHA2.hexdigest(project.id.to_s) } let(:hashed_prefix) { File.join('@hashed', hash[0..1], hash[2..3]) } @@ -4090,7 +4090,7 @@ describe Project do end describe '#has_ci?' do - set(:project) { create(:project) } + let_it_be(:project, reload: true) { create(:project) } let(:repository) { double } before do @@ -4134,7 +4134,7 @@ describe Project do Feature.get(:force_autodevops_on_by_default).enable_percentage_of_actors(0) end - set(:project) { create(:project) } + let_it_be(:project, reload: true) { create(:project) } subject { project.auto_devops_enabled? } @@ -4269,7 +4269,7 @@ describe Project do end describe '#has_auto_devops_implicitly_enabled?' do - set(:project) { create(:project) } + let_it_be(:project, reload: true) { create(:project) } context 'when disabled in settings' do before do @@ -4330,7 +4330,7 @@ describe Project do end describe '#has_auto_devops_implicitly_disabled?' do - set(:project) { create(:project) } + let_it_be(:project, reload: true) { create(:project) } before do allow(Feature).to receive(:enabled?).and_call_original @@ -4408,7 +4408,7 @@ describe Project do end describe '#api_variables' do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } it 'exposes API v4 URL' do expect(project.api_variables.first[:key]).to eq 'CI_API_V4_URL' @@ -4605,7 +4605,7 @@ describe Project do end describe '#write_repository_config' do - set(:project) { create(:project, :repository) } + let_it_be(:project) { create(:project, :repository) } it 'writes full path in .git/config when key is missing' do project.write_repository_config @@ -4696,7 +4696,7 @@ describe Project do end describe '#has_active_hooks?' do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } it { expect(project.has_active_hooks?).to be_falsey } @@ -4723,7 +4723,7 @@ describe Project do end describe '#has_active_services?' do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } it { expect(project.has_active_services?).to be_falsey } @@ -5009,8 +5009,8 @@ describe Project do describe '#members_among' do let(:users) { create_list(:user, 3) } - set(:group) { create(:group) } - set(:project) { create(:project, namespace: group) } + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, namespace: group) } before do project.add_guest(users.first) @@ -5584,6 +5584,14 @@ describe Project do end end + describe '#alerts_service_activated?' do + let!(:project) { create(:project) } + + subject { project.alerts_service_activated? } + + it { is_expected.to be_falsey } + end + def rugged_config rugged_repo(project.repository).config end |