object_manager_update_user_password_spec.rb 540 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe ObjectManagerUpdateUserPassword, type: :db_migration do
  4. let(:attr) do
  5. object_type = ObjectLookup.find_by(name: 'User')
  6. ObjectManager::Attribute.find_by object_lookup_id: object_type.id, name: 'password'
  7. end
  8. before do
  9. attr.data_option['maxlength'] = 123
  10. attr.save!
  11. end
  12. it 'changes maxlength' do
  13. expect { migrate }.to change { attr.reload.data_option[:maxlength] }.from(123).to(1001)
  14. end
  15. end