👋 update_attributes
You served us well...
This commit is contained in:
parent
ca80b753e7
commit
85dae98a76
46 changed files with 109 additions and 109 deletions
|
|
@ -84,7 +84,7 @@ describe Ticket do
|
|||
end
|
||||
|
||||
context 'user has paid' do
|
||||
before { ticket_purchase.update_attributes(paid: true) }
|
||||
before { ticket_purchase.update_attribute(:paid, true) }
|
||||
|
||||
it 'returns false' do
|
||||
expect(ticket.unpaid?(user)).to eq(false)
|
||||
|
|
@ -120,7 +120,7 @@ describe Ticket do
|
|||
|
||||
context 'user has paid' do
|
||||
let!(:ticket_purchase) { create(:ticket_purchase, user: user, ticket: ticket, quantity: 20) }
|
||||
before { ticket_purchase.update_attributes(paid: true) }
|
||||
before { ticket_purchase.update_attribute(:paid, true) }
|
||||
|
||||
it 'returns the correct value if the user has bought and paid for this ticket' do
|
||||
expect(ticket.quantity_bought_by(user, paid: true)).to eq(20)
|
||||
|
|
@ -145,7 +145,7 @@ describe Ticket do
|
|||
|
||||
context 'user has paid' do
|
||||
let!(:ticket_purchase) { create(:ticket_purchase, user: user, ticket: ticket, quantity: 20) }
|
||||
before { ticket_purchase.update_attributes(paid: true) }
|
||||
before { ticket_purchase.update_attribute(:paid, true) }
|
||||
|
||||
it 'returns the correct value if the user has bought this ticket' do
|
||||
expect(ticket.total_price(user, paid: true)).to eq(Money.new(100000, 'USD'))
|
||||
|
|
@ -203,7 +203,7 @@ describe Ticket do
|
|||
|
||||
it 'should allow currency update' do
|
||||
free_ticket = Ticket.first
|
||||
expect { free_ticket.update_attributes(price_currency: 'INR') }.to change { free_ticket.reload.price_currency }.from('USD').to('INR')
|
||||
expect { free_ticket.update_attribute(:price_currency, 'INR') }.to change { free_ticket.reload.price_currency }.from('USD').to('INR')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue