mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-03 21:43:40 -05:00
0aa69487a2
Conflicts: - `app/models/concerns/user/has_settings.rb`: Not a real conflict, upstream added a setting textually close to a glitch-soc one. Added upstream's new setting. - `app/views/settings/preferences/appearance/show.html.haml`: Not a real conflict, upstream added a setting textually close to a glitch-soc one. Added upstream's new setting. - `config/routes.rb`: Upstream moved web app routes to `config/routes/web_app.rb`, while glitch-soc had an extra route. Moved the extra route to `config/routes/web_app.rb`. - `spec/controllers/settings/preferences/appearance_controller_spec.rb`: This spec got converted to a system spec upstream. However, the theme setting works differently in glitch-soc, so the spec had been changed. Changed the corresponding system spec as well.
44 lines
1.1 KiB
Ruby
44 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe 'Settings preferences appearance page' do
|
|
let(:user) { Fabricate :user }
|
|
|
|
before { sign_in user }
|
|
|
|
it 'Views and updates user prefs' do
|
|
visit settings_preferences_appearance_path
|
|
|
|
expect(page)
|
|
.to have_private_cache_control
|
|
|
|
# TODO: glitch-soc's option is elsewhere
|
|
# select 'contrast', from: theme_selection_field
|
|
check confirm_reblog_field
|
|
uncheck confirm_delete_field
|
|
|
|
expect { save_changes }
|
|
.to change { user.reload.settings['web.reblog_modal'] }.to(true)
|
|
.and(change { user.reload.settings['web.delete_modal'] }.to(false))
|
|
expect(page)
|
|
.to have_title(I18n.t('settings.appearance'))
|
|
end
|
|
|
|
def save_changes
|
|
within('form') { click_on submit_button }
|
|
end
|
|
|
|
def confirm_delete_field
|
|
I18n.t('simple_form.labels.defaults.setting_delete_modal')
|
|
end
|
|
|
|
def confirm_reblog_field
|
|
I18n.t('simple_form.labels.defaults.setting_boost_modal')
|
|
end
|
|
|
|
def theme_selection_field
|
|
I18n.t('simple_form.labels.defaults.setting_theme')
|
|
end
|
|
end
|