Merge remote-tracking branch 'parent/main' into upstream-20241216

This commit is contained in:
KMY 2024-12-16 10:14:31 +09:00
commit 3784ad273c
555 changed files with 7564 additions and 3363 deletions

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Admin Terms of services' do
describe 'Viewing terms of services index page' do
let!(:terms) { Fabricate :terms_of_service, text: 'Test terms' }
before { sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
it 'allows tags listing and editing' do
visit admin_terms_of_service_index_path
expect(page)
.to have_title(I18n.t('admin.terms_of_service.title'))
expect(page)
.to have_content(terms.text)
end
end
end

View file

@ -34,7 +34,7 @@ RSpec.describe 'Log in' do
it 'A unconfirmed user is able to log in' do
fill_in_auth_details(email, password)
expect(subject).to have_css('div.admin-wrapper')
expect(subject).to have_css('.title', text: I18n.t('auth.setup.title'))
end
end

View file

@ -0,0 +1,34 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings verification page' do
let(:user) { Fabricate :user }
before { sign_in user }
describe 'Viewing the verification page' do
it 'shows the page and updates attribution' do
visit settings_verification_path
expect(page)
.to have_content(verification_summary)
.and have_private_cache_control
fill_in attribution_field, with: 'host.example'
expect { click_on submit_button }
.to(change { user.account.reload.attribution_domains_as_text })
expect(page)
.to have_content(success_message)
end
end
def verification_summary
I18n.t('verification.website_verification')
end
def attribution_field
I18n.t('simple_form.labels.account.attribution_domains_as_text')
end
end

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Terms of Service page' do
it 'visits the about page and renders the web app' do
visit terms_of_service_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
.and have_css('body', class: 'app-body')
end
end