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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/helpers/sidebars_helper_spec.rb
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/helpers/sidebars_helper_spec.rb')
-rw-r--r--spec/helpers/sidebars_helper_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/sidebars_helper_spec.rb b/spec/helpers/sidebars_helper_spec.rb
index 6db955f3637..299e4cb0133 100644
--- a/spec/helpers/sidebars_helper_spec.rb
+++ b/spec/helpers/sidebars_helper_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe SidebarsHelper do
+ include Devise::Test::ControllerHelpers
+
describe '#sidebar_tracking_attributes_by_object' do
subject { helper.sidebar_tracking_attributes_by_object(object) }
@@ -42,4 +44,26 @@ RSpec.describe SidebarsHelper do
end
end
end
+
+ describe '#super_sidebar_context' do
+ let(:user) { build(:user) }
+
+ subject { helper.super_sidebar_context(user) }
+
+ it 'returns sidebar values from user', :use_clean_rails_memory_store_caching do
+ Rails.cache.write(['users', user.id, 'assigned_open_issues_count'], 1)
+ Rails.cache.write(['users', user.id, 'assigned_open_merge_requests_count'], 2)
+ Rails.cache.write(['users', user.id, 'todos_pending_count'], 3)
+
+ expect(subject).to eq({
+ name: user.name,
+ username: user.username,
+ avatar_url: user.avatar_url,
+ assigned_open_issues_count: 1,
+ assigned_open_merge_requests_count: 2,
+ todos_pending_count: 3,
+ issues_dashboard_path: issues_dashboard_path(assignee_username: user.username)
+ })
+ end
+ end
end