diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-13 16:26:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-13 16:26:31 +0300 |
commit | b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch) | |
tree | 5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /spec/models/issue_spec.rb | |
parent | 25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 2e7d78d77a8..9c58d307c4c 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -7,6 +7,10 @@ describe Issue do describe "Associations" do it { is_expected.to belong_to(:milestone) } + it { is_expected.to belong_to(:project) } + it { is_expected.to belong_to(:moved_to).class_name('Issue') } + it { is_expected.to belong_to(:duplicated_to).class_name('Issue') } + it { is_expected.to belong_to(:closed_by).class_name('User') } it { is_expected.to have_many(:assignees) } end @@ -310,6 +314,22 @@ describe Issue do end end + describe '#duplicated?' do + let(:issue) { create(:issue) } + subject { issue.duplicated? } + + context 'issue not duplicated' do + it { is_expected.to eq false } + end + + context 'issue already duplicated' do + let(:duplicated_to_issue) { create(:issue) } + let(:issue) { create(:issue, duplicated_to: duplicated_to_issue) } + + it { is_expected.to eq true } + end + end + describe '#suggested_branch_name' do let(:repository) { double } |