summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-07-15 15:42:29 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-07-15 17:42:27 +0200
commit1556d4848d4753b7bddd8430cf223b91e6f47b0f (patch)
treebb4c140f0d7c6fb4509c3830bf7de7d586e3363b /spec/models
parent8b7932c21951de172d531ab8a3e9506c98db7483 (diff)
downloadgitlab-ce-1556d4848d4753b7bddd8430cf223b91e6f47b0f.tar.gz
Track a user who created a pipeline
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/pipeline_spec.rb3
-rw-r--r--spec/models/user_spec.rb2
2 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 4e5481f9154..10db79bd15f 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -5,9 +5,12 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { FactoryGirl.create :ci_pipeline, project: project }
it { is_expected.to belong_to(:project) }
+ it { is_expected.to belong_to(:user) }
+
it { is_expected.to have_many(:statuses) }
it { is_expected.to have_many(:trigger_requests) }
it { is_expected.to have_many(:builds) }
+
it { is_expected.to validate_presence_of :sha }
it { is_expected.to validate_presence_of :status }
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index ff39f187759..fc74488ac0e 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -31,6 +31,8 @@ describe User, models: true do
it { is_expected.to have_many(:spam_logs).dependent(:destroy) }
it { is_expected.to have_many(:todos).dependent(:destroy) }
it { is_expected.to have_many(:award_emoji).dependent(:destroy) }
+ it { is_expected.to have_many(:builds).dependent(:nullify) }
+ it { is_expected.to have_many(:pipelines).dependent(:nullify) }
describe '#group_members' do
it 'does not include group memberships for which user is a requester' do