1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-27 22:38:42 +09:00
YuruToot/spec/system/ocr_spec.rb
2024-07-08 16:01:08 +00:00

34 lines
844 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe 'OCR', :attachment_processing, :inline_jobs, :js, :streaming do
include ProfileStories
let(:email) { 'test@example.com' }
let(:password) { 'password' }
let(:confirmed_at) { Time.zone.now }
let(:finished_onboarding) { true }
before do
as_a_logged_in_user
visit root_path
end
it 'can recognize text in a media attachment' do
expect(page).to have_css('div.app-holder')
within('.compose-form') do
attach_file('file-upload-input', file_fixture('text.png'), make_visible: true)
within('.compose-form__upload') do
click_on('Edit')
end
end
click_on('Detect text from picture')
expect(page).to have_css('#upload-modal__description', text: /Hello Mastodon\s*/, wait: 10)
end
end