diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 12:09:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 12:09:20 +0000 |
commit | b84eeb256c4a780d902faee1f99ca9a711b3214a (patch) | |
tree | 32918aadbea9210eace50efbce9afbfb8cd3ba84 /spec/models | |
parent | 53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba (diff) | |
download | gitlab-ce-b84eeb256c4a780d902faee1f99ca9a711b3214a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index dc055244af7..6c90a1b5614 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -153,6 +153,16 @@ describe Project do expect(project.container_expiration_policy).to be_persisted end + it 'does not create another container expiration policy if there is already one' do + project = build(:project) + + expect do + container_expiration_policy = create(:container_expiration_policy, project: project) + + expect(project.container_expiration_policy).to eq(container_expiration_policy) + end.to change { ContainerExpirationPolicy.count }.by(1) + end + it 'automatically creates a Pages metadata row' do expect(project.pages_metadatum).to be_an_instance_of(ProjectPagesMetadatum) expect(project.pages_metadatum).to be_persisted |