1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/main' into kbtopic-remove-quote

This commit is contained in:
KMY 2025-05-27 10:51:58 +09:00
commit 7c65b6f9df
464 changed files with 8217 additions and 8135 deletions

View file

@ -26,6 +26,8 @@ RSpec.describe 'Admin Rules' do
it 'creates new record with valid attributes' do
visit admin_rules_path
click_on I18n.t('admin.rules.add_new')
# Invalid submission
fill_in 'rule_text', with: ''
expect { submit_form }
@ -46,6 +48,29 @@ RSpec.describe 'Admin Rules' do
end
end
describe 'Moving down an existing rule' do
let!(:first_rule) { Fabricate(:rule, text: 'This is another rule') }
let!(:second_rule) { Fabricate(:rule, text: 'This is a rule') }
it 'moves the rule down' do
visit admin_rules_path
expect(page)
.to have_content(I18n.t('admin.rules.title'))
expect(Rule.ordered.pluck(:text)).to eq ['This is another rule', 'This is a rule']
click_on(I18n.t('admin.rules.move_down'))
expect(page)
.to have_content(I18n.t('admin.rules.title'))
.and have_content(first_rule.text)
.and have_content(second_rule.text)
expect(Rule.ordered.pluck(:text)).to eq ['This is a rule', 'This is another rule']
end
end
describe 'Editing an existing rule' do
let!(:rule) { Fabricate :rule, text: 'Rule text' }

View file

@ -101,7 +101,7 @@ RSpec.describe 'Settings applications page' do
end
describe 'Destroying an application' do
let(:redis_pipeline_stub) { instance_double(Redis::Namespace, publish: nil) }
let(:redis_pipeline_stub) { instance_double(Redis::PipelinedConnection, publish: nil) }
let!(:access_token) { Fabricate(:accessible_access_token, application: application) }
before { stub_redis_pipeline }