Reviewed-on: #379 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #379 でマージされました.
このコミットが含まれているのは:
@@ -18,6 +18,13 @@ RSpec.describe 'Wiki API', type: :request do
|
||||
created_by_user: user,
|
||||
message: 'init')
|
||||
end
|
||||
let!(:tag) do
|
||||
Tag.create!(
|
||||
tag_name: tn,
|
||||
category: :general,
|
||||
deprecated_at: Time.zone.local(2026, 6, 1)
|
||||
)
|
||||
end
|
||||
|
||||
describe 'GET /wiki' do
|
||||
it 'returns wiki pages with title' do
|
||||
@@ -30,6 +37,8 @@ RSpec.describe 'Wiki API', type: :request do
|
||||
|
||||
expect(json[0]).to have_key('title')
|
||||
expect(json.map { |p| p['title'] }).to include('spec_wiki_title')
|
||||
wiki_json = json.find { |item| item.fetch('id') == page.id }
|
||||
expect(wiki_json.fetch('deprecated_at')).to eq(tag.deprecated_at.iso8601(3))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -48,7 +57,8 @@ RSpec.describe 'Wiki API', type: :request do
|
||||
|
||||
expect(json).to include(
|
||||
'id' => page.id,
|
||||
'title' => 'spec_wiki_title')
|
||||
'title' => 'spec_wiki_title',
|
||||
'deprecated_at' => tag.deprecated_at.iso8601(3))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -409,7 +419,11 @@ RSpec.describe 'Wiki API', type: :request do
|
||||
'kind' => 'content',
|
||||
'message' => 'r2'
|
||||
)
|
||||
expect(top['wiki_page']).to include('id' => page.id, 'title' => 'spec_wiki_title')
|
||||
expect(top['wiki_page']).to include(
|
||||
'id' => page.id,
|
||||
'title' => 'spec_wiki_title',
|
||||
'deprecated_at' => tag.deprecated_at.iso8601(3)
|
||||
)
|
||||
expect(top['user']).to include('id' => user.id, 'name' => user.name)
|
||||
expect(top).to have_key('timestamp')
|
||||
|
||||
@@ -479,6 +493,7 @@ RSpec.describe 'Wiki API', type: :request do
|
||||
expect(json).to include(
|
||||
'wiki_page_id' => page.id,
|
||||
'title' => 'spec_wiki_title',
|
||||
'deprecated_at' => tag.deprecated_at.iso8601(3),
|
||||
'older_revision_id' => rev_a.id,
|
||||
'newer_revision_id' => rev_b.id
|
||||
)
|
||||
|
||||
新しい課題から参照
ユーザをブロックする