Merge commit 'd9ea631d5911ebfe090e0d1ea1b11441aa58c918' into glitch-soc/merge-upstream
This commit is contained in:
commit
ff80786d2e
47 files changed
+174
-41
No files matched your search
@@ -13,7 +13,7 @@ RSpec.describe Account, '#fields' do
|
||||
it { is_expected.to_not allow_values(fields_over_limit, fields_empty_name).for(:fields) }
|
||||
|
||||
def fields_empty_name_value
|
||||
Array.new(4) { { 'name' => '', 'value' => '' } }
|
||||
Array.new(described_class::DEFAULT_FIELDS_SIZE) { %w(name value).index_with('') }
|
||||
end
|
||||
|
||||
def fields_over_limit
|
||||
@@ -151,6 +151,8 @@ RSpec.describe Account, '#fields' do
|
||||
describe '#build_fields' do
|
||||
let(:account) { Fabricate.build :account }
|
||||
|
||||
before { stub_const('Account::DEFAULT_FIELDS_SIZE', 4) }
|
||||
|
||||
context 'when fields already full' do
|
||||
before { account.fields = Array.new(Account::DEFAULT_FIELDS_SIZE) { |i| { name: "Name#{i}", value: 'Test' } } }
|
||||
|
||||
|
||||
Reference in new issue
Block a user