WIP Store avatars as ActiveStorage attachments
Also push to LDAP as jpegPhoto
This commit is contained in:
@@ -16,8 +16,6 @@ RSpec.describe 'Profile settings', type: :feature do
|
||||
.and_return({
|
||||
uid: user.cn, ou: user.ou, display_name: "Mark", pgp_key: nil
|
||||
})
|
||||
allow_any_instance_of(User).to receive(:avatar)
|
||||
.and_return(avatar_jpeg)
|
||||
end
|
||||
|
||||
feature "Update display name" do
|
||||
@@ -61,13 +59,16 @@ RSpec.describe 'Profile settings', type: :feature do
|
||||
end
|
||||
|
||||
scenario "fails with validation error for file size too large" do
|
||||
expect_any_instance_of(LdapManager::UpdateAvatar)
|
||||
.not_to receive(:replace_attribute).and_return(true)
|
||||
|
||||
visit setting_path(:profile)
|
||||
attach_file "Avatar", "#{Rails.root}/spec/fixtures/files/fsociety-irc.png"
|
||||
click_button "Save"
|
||||
|
||||
expect(current_url).to eq(setting_url(:profile))
|
||||
within ".error-msg" do
|
||||
expect(page).to have_content("file size is too large")
|
||||
expect(page).to have_content("must be less than 1MB")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user