Merge commit 'dc09c10fa8cc9230bf14e48d790c8f0c26043f8f' into glitch-soc/merge-upstream

Conflicts:
- `.rubocop_todo.yml`:
  Upstream re-generated the file, while glitch-soc has a specific ignore
  for some file.
  Updated the file as upstream did and kept our extra ignore.
- `config/webpack/shared.js`:
  Upstream added a plugin, but our files are pretty different.
  Added the plugin as well.
- `spec/helpers/application_helper_spec.rb`:
  Upstream refactored tests, but part of them were different because
  of glitch-soc's theming system.
  Applied the refactoring to glitch-soc's change.
This commit is contained in:
Claire
2023-08-24 21:26:27 +02:00
20 changed files with 103 additions and 78 deletions

View File

@@ -7,8 +7,7 @@ describe Admin::FilterHelper do
params = ActionController::Parameters.new(
{ test: 'test' }
)
allow(helper).to receive(:params).and_return(params)
allow(helper).to receive(:url_for).and_return('/test')
allow(helper).to receive_messages(params: params, url_for: '/test')
result = helper.filter_link_to('text', { resolved: true })
expect(result).to match(/text/)

View File

@@ -31,10 +31,7 @@ describe ApplicationHelper do
context 'with a body class string from a controller' do
before do
without_partial_double_verification do
allow(helper).to receive(:body_class_string).and_return('modal-layout compose-standalone')
allow(helper).to receive(:current_flavour).and_return('glitch')
allow(helper).to receive(:current_skin).and_return('default')
allow(helper).to receive(:current_account).and_return(Fabricate(:account))
allow(helper).to receive_messages(body_class_string: 'modal-layout compose-standalone', current_flavour: 'glitch', current_skin: 'default', current_account: Fabricate(:account))
end
end

View File

@@ -25,8 +25,7 @@ RSpec.describe HomeHelper do
it 'returns a link to the account' do
without_partial_double_verification do
allow(helper).to receive(:current_account).and_return(account)
allow(helper).to receive(:prefers_autoplay?).and_return(false)
allow(helper).to receive_messages(current_account: account, prefers_autoplay?: false)
result = helper.account_link_to(account)
expect(result).to match "@#{account.acct}"
@@ -101,8 +100,7 @@ RSpec.describe HomeHelper do
context 'with open registrations' do
it 'returns correct sign up message' do
allow(helper).to receive(:closed_registrations?).and_return(false)
allow(helper).to receive(:open_registrations?).and_return(true)
allow(helper).to receive_messages(closed_registrations?: false, open_registrations?: true)
result = helper.sign_up_message
expect(result).to eq t('auth.register')
@@ -111,9 +109,7 @@ RSpec.describe HomeHelper do
context 'with approved registrations' do
it 'returns correct sign up message' do
allow(helper).to receive(:closed_registrations?).and_return(false)
allow(helper).to receive(:open_registrations?).and_return(false)
allow(helper).to receive(:approved_registrations?).and_return(true)
allow(helper).to receive_messages(closed_registrations?: false, open_registrations?: false, approved_registrations?: true)
result = helper.sign_up_message
expect(result).to eq t('auth.apply_for_account')