diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-19 21:08:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-19 21:08:23 +0300 |
commit | 3f0db3db2ad99a74c3969bf2e930814004ccf1ec (patch) | |
tree | c8b4123b3b4b422b14211430b85556e64eb68a26 /spec/helpers | |
parent | 4a721269429a178957e8ce7c6d0a75d3307c9830 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/users_helper_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index 7fc811c1ac6..480b1e2a0de 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -396,4 +396,22 @@ RSpec.describe UsersHelper do end end end + + describe '#admin_user_actions_data_attributes' do + subject(:data) { helper.admin_user_actions_data_attributes(user) } + + before do + allow(helper).to receive(:current_user).and_return(user) + allow(Admin::UserEntity).to receive(:represent).and_call_original + end + + it 'user matches the serialized json' do + expect(data[:user]).to be_valid_json + expect(Admin::UserEntity).to have_received(:represent).with(user, hash_including({ current_user: user })) + end + + it 'paths matches the schema' do + expect(data[:paths]).to match_schema('entities/admin_users_data_attributes_paths') + end + end end |