diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-06-09 15:53:32 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-06-16 12:03:15 -0300 |
commit | 0520ee44985528d3076df1208bda7c6c7ff8ec79 (patch) | |
tree | c078ce331252d8c3ce6cd6e6f77f7646b5e143b1 /spec/models/concerns | |
parent | 85cdde8d3340dc0be28749225bf00923c84e5924 (diff) | |
download | gitlab-ce-0520ee44985528d3076df1208bda7c6c7ff8ec79.tar.gz |
Improve method names and add more specs
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/milestoneish_spec.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index 7616123b486..cefe7fb6fea 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -28,13 +28,13 @@ describe Milestone, 'Milestoneish' do project.team << [guest, :guest] end - describe '#issues_visible_to_user' do + describe '#sorted_issues' do it 'sorts issues by label priority' do issue.labels << label_1 security_issue_1.labels << label_2 closed_issue_1.labels << label_3 - issues = milestone.issues_visible_to_user(member) + issues = milestone.sorted_issues(member) expect(issues.first).to eq(issue) expect(issues.second).to eq(security_issue_1) @@ -43,14 +43,10 @@ describe Milestone, 'Milestoneish' do end describe '#sorted_merge_requests' do - let(:merge_request_1) { create(:merge_request, :simple, source_project: project, source_branch: 'branch_1', milestone: milestone) } - let(:merge_request_2) { create(:merge_request, :simple, source_project: project, source_branch: 'branch_2', milestone: milestone) } - let(:merge_request_3) { create(:merge_request, :simple, source_project: project, source_branch: 'branch_3', milestone: milestone) } - it 'sorts merge requests by label priority' do - merge_request_2.labels << label_1 - merge_request_1.labels << label_2 - merge_request_3.labels << label_3 + merge_request_1 = create(:labeled_merge_request, labels: [label_2], source_project: project, source_branch: 'branch_1', milestone: milestone) + merge_request_2 = create(:labeled_merge_request, labels: [label_1], source_project: project, source_branch: 'branch_2', milestone: milestone) + merge_request_3 = create(:labeled_merge_request, labels: [label_3], source_project: project, source_branch: 'branch_3', milestone: milestone) merge_requests = milestone.sorted_merge_requests |