このコミットが含まれているのは:
2026-01-28 23:44:17 +09:00
コミット 4832f9d99a
6個のファイルの変更69行の追加15行の削除
+4 -4
ファイルの表示
@@ -155,6 +155,7 @@ RSpec.describe 'Posts API', type: :request do
describe 'POST /posts' do
let(:member) { create(:user, :member) }
let!(:alias_tag_name) { TagName.create!(name: 'manko', canonical: tag_name) }
it '401 when not logged in' do
sign_out
@@ -201,10 +202,9 @@ RSpec.describe 'Posts API', type: :request do
expect(json).to include('id', 'title', 'url')
# tags が name を含むこと(API 側の serialization が正しいこと)
expect(json).to have_key('tags')
expect(json['tags']).to be_an(Array)
expect(json['tags'][0]).to have_key('name')
expect(json['tags'][0]['name']).to eq('spec_tag')
names = json.fetch('tags').map { |t| t['name'] }
expect(names).to include('spec_tag')
expect(names).not_to include('manko')
end
context "when nico tag already exists in tags" do