debian-mirror-gitlab/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb

25 lines
608 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'rails_helper'
2017-09-10 17:25:29 +05:30
feature 'User uploads avatar to profile' do
2017-08-17 22:00:37 +05:30
scenario 'they see their new avatar' do
user = create(:user)
2017-09-10 17:25:29 +05:30
sign_in(user)
2017-08-17 22:00:37 +05:30
visit profile_path
attach_file(
'user_avatar',
Rails.root.join('spec', 'fixtures', 'dk.png'),
visible: false
)
click_button 'Update profile settings'
visit user_path(user)
2017-09-10 17:25:29 +05:30
expect(page).to have_selector(%Q(img[data-src$="/uploads/-/system/user/avatar/#{user.id}/dk.png"]))
2017-08-17 22:00:37 +05:30
# Cheating here to verify something that isn't user-facing, but is important
expect(user.reload.avatar.file).to exist
end
end