このコミットが含まれているのは:
@@ -29,7 +29,9 @@ RSpec.describe HistoryAccess do
|
||||
admin = create(:user, :admin)
|
||||
admin_metadata = described_class.set(user: admin) { described_class.authority }
|
||||
TagVersion.create!(tag:, version_no: 1, event_type: 'discard', name: 'private',
|
||||
category: 'general', names: { ja: { name: 'private' } },
|
||||
category: 'general',
|
||||
names: { ja: { name: 'private', script_code: 'Jpan',
|
||||
auto_generated: false, aliases: [] } },
|
||||
aliases: '', parent_tag_ids: '', created_at: Time.utc(2024))
|
||||
described_class.set(user: nil) do
|
||||
expect(described_class.authorised_artifact?(public_metadata)).to be(false)
|
||||
|
||||
@@ -16,13 +16,13 @@ RSpec.describe 'Counts table API', type: :request do
|
||||
before do
|
||||
TagVersion.create!(tag:, version_no: 1, event_type: 'create', name: 'alpha',
|
||||
category: 'general', aliases: '', parent_tag_ids: '',
|
||||
names: { ja: { name: 'alpha', script_code: 'Jpan', aliases: [] } },
|
||||
names: { ja: { name: 'alpha', script_code: 'Jpan', auto_generated: false, aliases: [] } },
|
||||
created_at: Time.utc(2023))
|
||||
NicoTagVersion.create!(external_tag: external, version_no: 1,
|
||||
event_type: 'create', name: 'beta', linked_tags: '', created_at: Time.utc(2023))
|
||||
snapshots = [
|
||||
{ tag_id: tag.id, version_no: 1, name: 'alpha', category: 'general', sections: [] },
|
||||
{ external_tag_id: external.id, name: 'beta', sections: [] }]
|
||||
{ external_tag_id: external.id }]
|
||||
[1, 2, 3].each do |number|
|
||||
PostVersion.create!(post: record, version_no: number,
|
||||
event_type: number == 1 ? 'create' : 'update', url: record.url,
|
||||
|
||||
@@ -21,7 +21,29 @@ RSpec.describe 'Post filter identity across locales', type: :request do
|
||||
|
||||
['nico:shared', 'union_alias', 'not:nico:shared'].each do |literal|
|
||||
it "preserves the complete match set for #{ literal }" do
|
||||
get '/posts', params: { locale: 'ja', tags: literal }
|
||||
reference_params = { tag_refs: '' }
|
||||
|
||||
references.each_with_index do |reference, index|
|
||||
%w[name tag_id external_tag_id negative missing].each do |field|
|
||||
value = reference[field]
|
||||
next if value.nil?
|
||||
next if field == 'missing' && value == false
|
||||
|
||||
reference_params["tag_refs.#{index}.#{field}"] =
|
||||
case value
|
||||
when true
|
||||
'1'
|
||||
when false
|
||||
'0'
|
||||
else
|
||||
value.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
get '/posts', params: {
|
||||
locale: 'ain-Kana',
|
||||
tags: references.map { _1.fetch('name') }.join(' ') }.merge(reference_params)
|
||||
expect(response).to have_http_status(:ok)
|
||||
original_ids = json.fetch('posts').map { _1.fetch('id') }
|
||||
expected = literal.start_with?('not:') ? [other_post.id] :
|
||||
|
||||
@@ -55,7 +55,7 @@ RSpec.describe 'Tag description Wiki compatibility', type: :request do
|
||||
end
|
||||
|
||||
it 'does not fall back to a revision absent from new history' do
|
||||
versions.first.destroy!
|
||||
TagDescriptionVersion.where(id: versions.first.id).delete_all
|
||||
without_legacy_reads do
|
||||
get "/wiki/#{ description.id }", params: { version: versions.first.id }
|
||||
end
|
||||
@@ -190,7 +190,7 @@ RSpec.describe 'Tag description Wiki compatibility', type: :request do
|
||||
describe 'index' do
|
||||
[nil, 'description_contract'].each do |title|
|
||||
it "returns new content once in #{ title ? 'filtered' : 'unfiltered' } index" do
|
||||
get '/wiki', params: { title: }
|
||||
get '/wiki', params: title.nil? ? { } : { title: title }
|
||||
expect(response).to have_http_status(:ok)
|
||||
rows = json.select { |row| row.fetch('id') == description.id }
|
||||
expect(rows.size).to eq(1)
|
||||
|
||||
@@ -12,11 +12,16 @@ RSpec.describe 'Counts export contracts' do
|
||||
|
||||
around do |example|
|
||||
Dir.mktmpdir('counts-export-spec') do |path|
|
||||
allow(CountsExportDownload).to receive(:directory).and_return(Pathname.new(path))
|
||||
@counts_export_dir = Pathname.new(path)
|
||||
HistoryAccess.set(user: nil) { example.run }
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
allow(CountsExportDownload).to receive(:directory)
|
||||
.and_return(@counts_export_dir)
|
||||
end
|
||||
|
||||
context 'serialization after the authorised query' do
|
||||
let(:rows) { [{ title: "=formula\n\"quoted\"" }, { title: 'second' }] }
|
||||
let(:page) do
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする