Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-09-06 22:00:34 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-09-06 22:00:34 +0300
commit632f6ba267bc09a658defc3721d2b52de05cf7e6 (patch)
treee486d01082cab7ba12cca31831fe6f6dd37f1d88 /spec/models/project_auto_devops_spec.rb
parent5941f3a7e8628e8792c9dbfad07f9b4d6ba7fb2e (diff)
Add tests to cover all introduced changes
Diffstat (limited to 'spec/models/project_auto_devops_spec.rb')
-rw-r--r--spec/models/project_auto_devops_spec.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/models/project_auto_devops_spec.rb b/spec/models/project_auto_devops_spec.rb
index 08cb7c4c1b1..ca13af4d73e 100644
--- a/spec/models/project_auto_devops_spec.rb
+++ b/spec/models/project_auto_devops_spec.rb
@@ -1,14 +1,23 @@
require 'spec_helper'
describe ProjectAutoDevops do
- subject { build_stubbed(:project_auto_devops) }
+ set(:project) { build(:project) }
it { is_expected.to belong_to(:project) }
- it { is_expected.to validate_presence_of(:domain) }
-
it { is_expected.to respond_to(:created_at) }
it { is_expected.to respond_to(:updated_at) }
- it { is_expected.to be_enabled }
+ describe 'variables' do
+ let(:auto_devops) { build_stubbed(:project_auto_devops, project: project, domain: domain) }
+
+ context 'when domain is defined' do
+ let(:domain) { 'example.com' }
+
+ it 'returns AUTO_DEVOPS_DOMAIN' do
+ expect(auto_devops.variables).to include(
+ { key: 'AUTO_DEVOPS_DOMAIN', value: 'example.com', public: true })
+ end
+ end
+ end
end