diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-05 17:50:07 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-05 17:50:07 +0000 |
commit | cf9e29672ce0df9647eecd94d099d15dc1bdac0e (patch) | |
tree | 89114aa9f73588176b44fe4a28312475211bdb0b /spec/models | |
parent | df176fe747cad64fd86f8b91fe94f8b40bbd8a04 (diff) | |
parent | 24a11c957a34d2f22c0276fa8dcc3e2c23d1f164 (diff) | |
download | gitlab-ce-cf9e29672ce0df9647eecd94d099d15dc1bdac0e.tar.gz |
Merge branch '32282-add-foreign-keys-to-todos' into 'master'
Add missing foreign key and NOT NULL constraints to todos table.
Closes #32282
See merge request gitlab-org/gitlab-ce!16849
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/note_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/todo_spec.rb | 1 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 00dda7c9c60..c853f707e6d 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -8,7 +8,7 @@ describe Note do it { is_expected.to belong_to(:noteable).touch(false) } it { is_expected.to belong_to(:author).class_name('User') } - it { is_expected.to have_many(:todos).dependent(:destroy) } + it { is_expected.to have_many(:todos) } end describe 'modules' do diff --git a/spec/models/todo_spec.rb b/spec/models/todo_spec.rb index 3e8f3848eca..bd498269798 100644 --- a/spec/models/todo_spec.rb +++ b/spec/models/todo_spec.rb @@ -20,6 +20,7 @@ describe Todo do it { is_expected.to validate_presence_of(:action) } it { is_expected.to validate_presence_of(:target_type) } it { is_expected.to validate_presence_of(:user) } + it { is_expected.to validate_presence_of(:author) } context 'for commits' do subject { described_class.new(target_type: 'Commit') } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 18c91d4cffd..af79ea4c283 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -33,7 +33,7 @@ describe User do it { is_expected.to have_many(:merge_requests).dependent(:destroy) } it { is_expected.to have_many(:identities).dependent(:destroy) } 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(:todos) } it { is_expected.to have_many(:award_emoji).dependent(:destroy) } it { is_expected.to have_many(:triggers).dependent(:destroy) } it { is_expected.to have_many(:builds).dependent(:nullify) } |