summaryrefslogtreecommitdiff
path: root/spec/models/group_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 0a08b15a1eb..ddf12c8e4c4 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -640,6 +640,12 @@ RSpec.describe Group do
it { is_expected.to match_array([private_group, internal_group]) }
end
+ describe 'private_only' do
+ subject { described_class.private_only.to_a }
+
+ it { is_expected.to match_array([private_group]) }
+ end
+
describe 'with_onboarding_progress' do
subject { described_class.with_onboarding_progress }
@@ -2598,6 +2604,21 @@ RSpec.describe Group do
it { is_expected.to eq(Set.new([child_1.id])) }
end
+ describe '.timelogs' do
+ let(:project) { create(:project, namespace: group) }
+ let(:issue) { create(:issue, project: project) }
+ let(:other_project) { create(:project, namespace: create(:group)) }
+ let(:other_issue) { create(:issue, project: other_project) }
+
+ let!(:timelog1) { create(:timelog, issue: issue) }
+ let!(:timelog2) { create(:timelog, issue: other_issue) }
+ let!(:timelog3) { create(:timelog, issue: issue) }
+
+ it 'returns timelogs belonging to the group' do
+ expect(group.timelogs).to contain_exactly(timelog1, timelog3)
+ end
+ end
+
describe '#to_ability_name' do
it 'returns group' do
group = build(:group)