このコミットが含まれているのは:
@@ -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
|
||||
|
||||
新しい課題から参照
ユーザをブロックする