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