Fix: #950 新規アンテナ作成時にリストへ挿入するを設定しても、ホーム挿入になる (#975)

* Fix: #950 新規アンテナ作成時にリストへ挿入するを設定しても、ホーム挿入になる

* Fix test
This commit is contained in:
KMY(雪あすか) 2025-01-31 12:04:26 +09:00 committed by GitHub
parent 80cace410f
commit 915ee553da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 5 deletions

View file

@ -123,6 +123,20 @@ RSpec.describe 'Antennas' do
expect(Antenna.where(account: user.account).count).to eq(1)
end
context 'when specify a list when create new' do
let(:list) { Fabricate(:list, account: user.account, title: 'ohagi') }
let(:params) { { title: 'my antenna', list_id: list.id.to_s, insert_feeds: 'true' } }
it 'returns the new antenna with list', :aggregate_failures do
subject
expect(response).to have_http_status(200)
expect(response.parsed_body).to match(a_hash_including(title: 'my antenna', insert_feeds: true))
expect(response.parsed_body['list']).to match(a_hash_including(id: list.id.to_s, title: list.title))
expect(Antenna.where(account: user.account).count).to eq(1)
end
end
context 'when a title is not given' do
let(:params) { { title: '' } }