forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add end-to-end test for OCR in media uploads (mastodon#29148)
- Loading branch information
1 parent
a9e91eb
commit ca8fbda
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe 'OCR', :paperclip_processing, :sidekiq_inline do | ||
include ProfileStories | ||
|
||
let(:email) { '[email protected]' } | ||
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') | ||
end | ||
end |