Skip to content

Commit

Permalink
Merge pull request #303 from widefix/hotfix-edit-account
Browse files Browse the repository at this point in the history
fix(account): hotfix account edit
  • Loading branch information
VladislavSokov authored Dec 1, 2023
2 parents 28c8782 + 4fdbd83 commit 8323fb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/accounts/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.column.is-one-third
h2.title.is-4.has-text-centered Edit account
= form_with model: account do |f|
.columns.is-mobile.is-justify-content-space-between#account-background(style="background-image: url('#{url_for(account.background)}');" class="account-has-bg" - if account.background.attached?)
.columns.is-mobile.is-justify-content-space-between#account-background(style="#{"background-image: url('#{url_for(account.background)}');" if account.background.attached?}" class="#{'account-has-bg' if account.background.attached?}")
.column.is-one-third
.field
.figure.image.is-128x128(class="#{'bg-around-image' if account.background.attached?}")
Expand Down
3 changes: 2 additions & 1 deletion spec/models/account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:parent) { create(:account, :parent) }
let(:child) { create(:account, :children, parent: parent) }
let!(:first_transaction) do
create(:transaction, to_account: child, from_account: parent, amount: 100.0, created_at: 1.month.ago)
create(:transaction, to_account: child, from_account: parent, amount: 100.0, created_at: 40.day.ago)
end
let!(:second_transaction) do
create(:transaction, to_account: parent, from_account: child, amount: 70.0, created_at: 1.week.ago)
Expand Down Expand Up @@ -47,6 +47,7 @@
expect(child.accumulative_balance_data)
.to eq({
first_transaction.created_at.beginning_of_month.to_date.strftime('%Y-%m-%d') => 100.0,
second_transaction.created_at.beginning_of_month.to_date.strftime('%Y-%m-%d') => 30.0,
third_transaction.created_at.beginning_of_month.to_date.strftime('%Y-%m-%d') => 80.0
})
end
Expand Down

0 comments on commit 8323fb0

Please sign in to comment.