diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-07 00:08:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-07 00:08:25 +0000 |
commit | 3e31cffa203fd718381421e8035f7161a9f0338e (patch) | |
tree | 5d37928bebf08ddc931efe04a85d66217c8a0cea /spec/models/concerns | |
parent | 1c25ac983cd1e4335faa1ec4922c314d6321e224 (diff) | |
download | gitlab-ce-3e31cffa203fd718381421e8035f7161a9f0338e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/milestoneish_spec.rb | 64 |
1 files changed, 10 insertions, 54 deletions
diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index 71a18e2fbec..cff607a4731 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -213,7 +213,7 @@ describe Milestone, 'Milestoneish' do describe '#complete?', :use_clean_rails_memory_store_caching do it 'returns false when has items opened' do - expect(milestone.complete?(non_member)).to eq false + expect(milestone.complete?).to eq false end it 'returns true when all items are closed' do @@ -221,7 +221,7 @@ describe Milestone, 'Milestoneish' do security_issue_1.close security_issue_2.close - expect(milestone.complete?(non_member)).to eq true + expect(milestone.complete?).to eq true end end @@ -229,63 +229,19 @@ describe Milestone, 'Milestoneish' do context 'division by zero' do let(:new_milestone) { build_stubbed(:milestone) } - it { expect(new_milestone.percent_complete(admin)).to eq(0) } + it { expect(new_milestone.percent_complete).to eq(0) } end end - describe '#count_issues_by_state' do - describe '#total_issues_count', :use_clean_rails_memory_store_caching do - it 'counts all issues including confidential' do - expect(milestone.total_issues_count(guest)).to eq 9 - end - end - - describe '#opened_issues_count', :use_clean_rails_memory_store_caching do - it 'counts all open issues including confidential' do - expect(milestone.opened_issues_count(guest)).to eq 3 - end + describe '#closed_issues_count' do + it 'counts all closed issues including confidential' do + expect(milestone.closed_issues_count).to eq 6 end + end - describe '#closed_issues_count', :use_clean_rails_memory_store_caching do - it 'counts all closed issues including confidential' do - expect(milestone.closed_issues_count(guest)).to eq 6 - end - end - - context 'when cached_milestone_issue_counters are disabled' do - before do - stub_feature_flags(cached_milestone_issue_counters: false) - end - - it 'does not count confidential issues for non project members' do - expect(milestone.closed_issues_count(non_member)).to eq 2 - expect(milestone.total_issues_count(non_member)).to eq 3 - end - - it 'does not count confidential issues for project members with guest role' do - expect(milestone.closed_issues_count(guest)).to eq 2 - expect(milestone.total_issues_count(guest)).to eq 3 - end - - it 'counts confidential issues for author' do - expect(milestone.closed_issues_count(author)).to eq 4 - expect(milestone.total_issues_count(author)).to eq 6 - end - - it 'counts confidential issues for assignee' do - expect(milestone.closed_issues_count(assignee)).to eq 4 - expect(milestone.total_issues_count(assignee)).to eq 6 - end - - it 'counts confidential issues for project members' do - expect(milestone.closed_issues_count(member)).to eq 6 - expect(milestone.total_issues_count(member)).to eq 9 - end - - it 'counts confidential issues for admin' do - expect(milestone.closed_issues_count(admin)).to eq 6 - expect(milestone.total_issues_count(admin)).to eq 9 - end + describe '#total_issues_count' do + it 'counts all issues including confidential' do + expect(milestone.total_issues_count).to eq 9 end end |