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:
Diffstat (limited to 'spec/helpers/organizations/organization_helper_spec.rb')
-rw-r--r--spec/helpers/organizations/organization_helper_spec.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/helpers/organizations/organization_helper_spec.rb b/spec/helpers/organizations/organization_helper_spec.rb
index 9d55d2a84f8..594013d515b 100644
--- a/spec/helpers/organizations/organization_helper_spec.rb
+++ b/spec/helpers/organizations/organization_helper_spec.rb
@@ -94,9 +94,12 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do
describe '#home_organization_setting_app_data' do
it 'returns expected json' do
+ current_user = build_stubbed(:user)
+ allow(helper).to receive(:current_user).and_return(current_user)
+
expect(Gitlab::Json.parse(helper.home_organization_setting_app_data)).to eq(
{
- 'initial_selection' => 1
+ 'initial_selection' => current_user.user_preference.home_organization_id
}
)
end
@@ -119,10 +122,13 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do
end
describe '#organization_user_app_data' do
- it 'returns expected data object' do
- expect(helper.organization_user_app_data(organization)).to eq(
+ it 'returns expected json' do
+ expect(Gitlab::Json.parse(helper.organization_user_app_data(organization))).to eq(
{
- organization_gid: organization.to_global_id
+ 'organization_gid' => organization.to_global_id.to_s,
+ 'paths' => {
+ 'admin_user' => admin_user_path(:id)
+ }
}
)
end