Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-07 06:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-07 06:09:37 +0300
commit3e59f1f11a387ab3e0383f7beea8ea599291a293 (patch)
tree6fbbe3ba17b30e60e535d73912b99f794d746d01 /spec
parent1e19d757e8a088e9d4aa67cc092fda87aba1cd35 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/storage_helper_spec.rb5
-rw-r--r--spec/models/note_spec.rb24
2 files changed, 28 insertions, 1 deletions
diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb
index d37ab7f14a5..b2da9fa8801 100644
--- a/spec/helpers/storage_helper_spec.rb
+++ b/spec/helpers/storage_helper_spec.rb
@@ -42,7 +42,10 @@ RSpec.describe StorageHelper do
)
end
- let(:message) { 'Repository: 10 KiB / Wikis: 10 B / Build Artifacts: 30 MiB / Pipeline Artifacts: 11 MiB / LFS: 20 GiB / Snippets: 40 MiB / Packages: 12 MiB / Uploads: 15 MiB' }
+ let(:message) do
+ 'Repository: 10 KiB / Wikis: 10 B / Build Artifacts: 30 MiB / Pipeline Artifacts: 11 MiB / ' \
+ 'LFS: 20 GiB / Snippets: 40 MiB / Packages: 12 MiB / Uploads: 15 MiB'
+ end
it 'works on ProjectStatistics' do
expect(helper.storage_counters_details(project.statistics)).to eq(message)
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index f722415d428..1453ce9709f 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -1695,6 +1695,30 @@ RSpec.describe Note, feature_category: :team_planning do
end
end
end
+
+ describe '.authored_by' do
+ subject(:notes_by_author) { described_class.authored_by(author) }
+
+ let(:author) { create(:user) }
+
+ it 'returns the notes with the matching author' do
+ note = create(:note, author: author)
+ create(:note)
+
+ expect(notes_by_author).to contain_exactly(note)
+ end
+
+ context 'With ID integer' do
+ subject(:notes_by_author) { described_class.authored_by(author.id) }
+
+ it 'returns the notes with the matching author' do
+ note = create(:note, author: author)
+ create(:note)
+
+ expect(notes_by_author).to contain_exactly(note)
+ end
+ end
+ end
end
describe 'banzai_render_context' do