replace update_attributes with updat since deprecated
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
viehlieb 2022-10-13 18:25:52 +02:00
parent 85270e70cf
commit af3444bba6
25 changed files with 42 additions and 42 deletions

View file

@ -104,7 +104,7 @@ describe Article do
# TODO move article sync from supplier to article
article # need to reference for it to exist when syncing
updated_article = supplier.sync_all[0].select { |s| s[0].id == article.id }.first[0]
article.update_attributes updated_article.attributes.reject { |k, v| k == 'id' or k == 'type' }
article.update updated_article.attributes.reject { |k, v| k == 'id' or k == 'type' }
expect(article.name).to eq(shared_article.name)
# now synchronising shouldn't change anything anymore
expect(article.shared_article_changed?).to be_falsey
@ -127,14 +127,14 @@ describe Article do
article.save!
# TODO get sync functionality in article
updated_article = supplier.sync_all[0].select { |s| s[0].id == article.id }.first[0]
article.update_attributes! updated_article.attributes.reject { |k, v| k == 'id' or k == 'type' }
article.update! updated_article.attributes.reject { |k, v| k == 'id' or k == 'type' }
expect(article.unit).to eq '200g'
expect(article.unit_quantity).to eq 5
expect(article.price).to be_within(0.005).of(shared_article.price / 5)
end
it 'does not synchronise when it has no order number' do
article.update_attributes :order_number => nil
article.update :order_number => nil
expect(supplier.sync_all).to eq [[], [], []]
end
end

View file

@ -151,7 +151,7 @@ describe OrderArticle do
# actual test
it(success ? 'succeeds' : 'fails') do
order.update_attributes(boxfill: boxfill_from)
order.update(boxfill: boxfill_from)
r = proc {
goa.update_quantities(*q.values[0])

View file

@ -127,13 +127,13 @@ describe Ordergroup do
expect(og.account_balance).to eq 444
ftc1.reload
ftc1.update_attributes!(ignore_for_account_balance: true)
ftc1.update!(ignore_for_account_balance: true)
og.reload
expect(og.account_balance).to eq 440
ftt2.reload
ftt2.update_attributes!(financial_transaction_class: ftc1)
ftt2.update!(financial_transaction_class: ftc1)
og.reload
expect(og.account_balance).to eq 400
@ -146,7 +146,7 @@ describe Ordergroup do
expect(result["sum_of_class_#{ftc2.id}"]).to eq 440
ftt2.reload
ftt2.update_attributes!(financial_transaction_class: ftc1)
ftt2.update!(financial_transaction_class: ftc1)
result = Ordergroup.include_transaction_class_sum.where(id: og).first
expect(result["sum_of_class_#{ftc1.id}"]).to eq 44