profile_spec.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. require 'rails_helper'
  2. require 'system/examples/text_modules_examples'
  3. RSpec.describe 'User Profile', type: :system do
  4. let(:customer) { create(:customer) }
  5. describe 'object manager attributes maxlength', authenticated_as: :authenticate, db_strategy: :reset do
  6. def authenticate
  7. customer
  8. create :object_manager_attribute_text, object_name: 'User', name: 'maxtest', display: 'maxtest', screens: attributes_for(:required_screen), data_option: {
  9. 'type' => 'text',
  10. 'maxlength' => 3,
  11. 'null' => true,
  12. 'translate' => false,
  13. 'default' => '',
  14. 'options' => {},
  15. 'relation' => '',
  16. }
  17. ObjectManager::Attribute.migration_execute
  18. true
  19. end
  20. it 'checks ticket create' do
  21. visit "#user/profile/#{customer.id}"
  22. within(:active_content) do
  23. page.find('.profile .js-action').click
  24. page.find('.profile li[data-type=edit]').click
  25. fill_in 'maxtest', with: 'hellu'
  26. expect(page.find_field('maxtest').value).to eq('hel')
  27. end
  28. end
  29. end
  30. end