1
0
Fork 0
forked from gitea/nas

Extract frontend_translations helper to support module (#34400)

This commit is contained in:
Matt Jankowski 2025-04-10 09:51:17 -04:00 committed by GitHub
parent 4c2f64907b
commit de19af3650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 32 deletions

View file

@ -23,24 +23,14 @@ RSpec.describe 'Share page', :js, :streaming do
fill_in_form
expect(page)
.to have_css('.notification-bar-message', text: translations['compose.published.body'])
.to have_css('.notification-bar-message', text: frontend_translations('compose.published.body'))
end
def fill_in_form
within('.compose-form') do
fill_in translations['compose_form.placeholder'],
fill_in frontend_translations('compose_form.placeholder'),
with: 'This is a new status!'
click_on translations['compose_form.publish']
click_on frontend_translations('compose_form.publish')
end
end
def translations
# TODO: Extract to system spec helper for re-use?
JSON.parse(
Rails
.root
.join('app', 'javascript', 'mastodon', 'locales', 'en.json')
.read
)
end
end