fix one flaky test

This commit is contained in:
viehlieb 2023-10-13 19:03:55 +02:00
parent 03884e83a3
commit 8f05dd440e
10 changed files with 89 additions and 37 deletions

View file

@ -8,6 +8,7 @@ class Finance::BalancingController < Finance::BaseController
flash.now.alert = t('.alert') if @order.closed?
@comments = @order.comments
@articles = @order.order_articles.ordered_or_member.includes(:article, :article_price,
group_order_articles: { group_order: :ordergroup })
@ -24,7 +25,6 @@ class Finance::BalancingController < Finance::BaseController
else
@articles
end
render layout: false if request.xhr?
end

View file

@ -0,0 +1 @@
= render partial: 'finance/balancing/edit_results_by_articles', locals: {order: @order, articles: @articles, comments: @comments }

View file

@ -36,28 +36,28 @@
%th= heading_helper Article, :tax
%th= heading_helper Article, :deposit
%th{:colspan => "2"}
- unless @order.closed?
- unless order.closed?
.btn-group
= link_to t('.add_article'), new_order_order_article_path(@order), remote: true,
= link_to t('.add_article'), new_order_order_article_path(order), remote: true,
class: 'btn btn-small'
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-small dropdown-toggle' do
%span.caret
%ul.dropdown-menu
%li= link_to t('.add_article'), new_order_order_article_path(@order), remote: true
%li= link_to t('.edit_transport'), edit_transport_finance_order_path(@order), remote: true
%li= link_to t('.add_article'), new_order_order_article_path(order), remote: true
%li= link_to t('.edit_transport'), edit_transport_finance_order_path(order), remote: true
%tbody.list#result_table
- for order_article in @articles.select { |oa| oa.units > 0 }
- for order_article in articles.select { |oa| oa.units > 0 }
= render :partial => "order_article_result", :locals => {:order_article => order_article}
%tr
%td{ colspan: 10 } The following were not ordered
- for order_article in @articles.select { |oa| oa.units == 0 }
- for order_article in articles.select { |oa| oa.units == 0 }
= render :partial => "order_article_result", :locals => {:order_article => order_article}
- if @order.transport
- if order.transport
%tr
%td{ colspan: 5 }= heading_helper Order, :transport
%td{ colspan: 3, data: {value: @order.transport} }= number_to_currency(@order.transport)
%td= link_to t('ui.edit'), edit_transport_finance_order_path(@order), remote: true,
%td{ colspan: 3, data: {value: order.transport} }= number_to_currency(order.transport)
%td= link_to t('ui.edit'), edit_transport_finance_order_path(order), remote: true,
class: 'btn btn-mini' unless order_article.order.closed?

View file

@ -1,3 +0,0 @@
%section#results
= render 'edit_results_by_articles'

View file

@ -76,6 +76,7 @@
%li= link_to t('.articles_overview'), new_finance_order_path(order_id: @order.id, view: 'articles_overview'),
remote: true
= render "results"
%section#results
= render partial: 'article_results', locals: { order: @order, articles: @articles, comments: @comments }
%p= link_to_top