このコミットが含まれているのは:
2026-09-23 09:41:41 +09:00
コミット 2490ed91c4
5個のファイルの変更194行の追加49行の削除
+4 -12
ファイルの表示
@@ -1,20 +1,12 @@
require 'rails_helper'
RSpec.describe NicoTagRelation, type: :model do
it 'accepts an ExternalTag regardless of its platform' do
id = ExternalTag.maximum(:id).to_i + 10_000
ExternalTag.insert_all!([
{ id:,
platform: 'spec_external',
name: 'external_name',
post_count: 0,
created_at: Time.current }])
external_tag = ExternalTag.find(id)
it 'does not constrain the ExternalTag association to the nico platform' do
external_tag = create(:external_tag)
tag = create(:tag)
allow(external_tag).to receive(:platform).and_return('registered_external')
allow(external_tag).to receive(:nico?).and_return(false)
expect(external_tag.platform_before_type_cast).to eq('spec_external')
expect {
described_class.create!(nico_tag: external_tag, tag:)
}.to change(described_class, :count).by(1)