diff --git a/app/assets/javascripts/supplier/app/templates/active_list.emblem b/app/assets/javascripts/supplier/app/templates/active_list.emblem index 6acfc60b..f98a0404 100644 --- a/app/assets/javascripts/supplier/app/templates/active_list.emblem +++ b/app/assets/javascripts/supplier/app/templates/active_list.emblem @@ -8,8 +8,8 @@ td.status-icons | span.icon.needs-payment td.numeric.table_number: App.TableNumberWithInfoView contextBinding="view.content" -td.section_title: link-to 'section' view.content.section.id: span=view.content.section.title -td.currency.total_list_amount {{currency view.content.total}} +td.section_title: link-to 'section' view.content.table.section.id: span=view.content.table.section.title +td.currency.total_list_amount=currency view.content.total td.actions / if view.content.needs_help button.mark_list_as_helped{ action "markListAsHelped" view.content.id} diff --git a/app/assets/javascripts/supplier/app/templates/active_order.emblem b/app/assets/javascripts/supplier/app/templates/active_order.emblem index 0ab45987..d29a1f07 100644 --- a/app/assets/javascripts/supplier/app/templates/active_order.emblem +++ b/app/assets/javascripts/supplier/app/templates/active_order.emblem @@ -5,7 +5,7 @@ td.status-icons span.active-order.fa.fa-check.fa-lg td= view.content.display td.numeric.table_number: App.TableNumberWithInfoView contextBinding="view.content.list" -td.section_title: link-to 'section' view.content.list.section.id: span=view.content.list.section.title +td.section_title: link-to 'section' view.content.list.table.section.id: span=view.content.list.table.section.title td.currency=currency view.content.total td.actions if view.content.placed diff --git a/app/assets/javascripts/supplier/foundation1/qsupplier.js.coffee.erb b/app/assets/javascripts/supplier/foundation1/qsupplier.js.coffee.erb index 14c84cad..3825c01d 100644 --- a/app/assets/javascripts/supplier/foundation1/qsupplier.js.coffee.erb +++ b/app/assets/javascripts/supplier/foundation1/qsupplier.js.coffee.erb @@ -3,7 +3,12 @@ root.Qsupplier= watch_events: -> faye = new Faye.Client(event_host) faye.subscribe "/supplier/#{supplier_object.id}", (e)=> -<% if Rails.env.development? %> +<% if Rails.env.test? %> + window.faye_log ||= [] + faye_message = {} + faye_message[e.event] = e.data + faye_log.push faye_message +<% elsif Rails.env.development? %> console.log "Event: #{e.event}" console.log e.data <% end %> diff --git a/spec/acceptance/suppliers/dashboard.feature b/spec/acceptance/suppliers/dashboard.feature index 24f6f1bb..ec5f76d4 100644 --- a/spec/acceptance/suppliers/dashboard.feature +++ b/spec/acceptance/suppliers/dashboard.feature @@ -75,11 +75,12 @@ Feature: Supplier main board @javascript Scenario: Update table number and section if table changes Given there is an active list and order + And there is another section with table And I am signed in as supplier # wait until page is fully loaded - And I wait 2 seconds + And I wait 4 seconds When the active list changes to another table in another section - And I wait 1 second + And I wait 2 seconds Then the supplier main board table number should be updated to the new table number And the supplier main board section name should be updated to the new section diff --git a/spec/acceptance_steps/global_section_steps.rb b/spec/acceptance_steps/global_section_steps.rb index df8da35b..c7ac88d4 100644 --- a/spec/acceptance_steps/global_section_steps.rb +++ b/spec/acceptance_steps/global_section_steps.rb @@ -1,3 +1,12 @@ step 'there is a section' do @section ||= create :section, supplier: @supplier end + +step "there is another section" do + @other_section = create :section, supplier: @supplier, title: 'New Section' +end + +step "there is another section with table" do + step "there is another section" + @other_table = create :table, section: @other_section, supplier: @supplier, number: 65 +end diff --git a/spec/acceptance_steps/suppliers/dashboard_steps.rb b/spec/acceptance_steps/suppliers/dashboard_steps.rb index f5cb2711..9f84438b 100644 --- a/spec/acceptance_steps/suppliers/dashboard_steps.rb +++ b/spec/acceptance_steps/suppliers/dashboard_steps.rb @@ -131,8 +131,6 @@ step "I click on the section main board section jumper" do end step "the active list changes to another table in another section" do - @other_section = create :section, supplier: @supplier, title: 'New Section' - @other_table = create :table, section: @other_section, supplier: @supplier, number: 65 @list.move_to_table! @other_table end diff --git a/spec/support/ember_helpers.rb b/spec/support/ember_helpers.rb index 65201084..41535418 100644 --- a/spec/support/ember_helpers.rb +++ b/spec/support/ember_helpers.rb @@ -18,4 +18,8 @@ module SpecEmberHelpers def js_path page.evaluate_script 'location.pathname + location.hash' end + + def faye_log + page.evaluate_script(%|window.faye_log|) + end end