From c36c88bc15b176f022d05e7b4440f09b0b045015 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Thu, 27 Nov 2014 20:16:30 +0100 Subject: [PATCH] Fix some failing spec --- .../modals/close_list_controller.js.coffee | 3 ++- .../app/models/product_category.js.coffee | 2 +- spec/acceptance/suppliers/dashboard.feature | 1 - spec/acceptance/users/changing_table.feature | 2 +- .../suppliers/dashboard_steps.rb | 18 +++++++++--------- .../users/changing_table_steps.rb | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/supplier/app/controllers/modals/close_list_controller.js.coffee b/app/assets/javascripts/supplier/app/controllers/modals/close_list_controller.js.coffee index a02206d7..dd48bda2 100644 --- a/app/assets/javascripts/supplier/app/controllers/modals/close_list_controller.js.coffee +++ b/app/assets/javascripts/supplier/app/controllers/modals/close_list_controller.js.coffee @@ -2,5 +2,6 @@ App.modals.CloseListController = App.modals.BaseController.extend title_path: 'list.close.modal.title' actions: confirm: -> - @get('model').then (l)->l.close() + model = @get('model') + if model.then then model.then((l) -> l.close()) else model.close() @send 'closeModal' diff --git a/app/assets/javascripts/supplier/app/models/product_category.js.coffee b/app/assets/javascripts/supplier/app/models/product_category.js.coffee index 95e5076b..2b7b8844 100644 --- a/app/assets/javascripts/supplier/app/models/product_category.js.coffee +++ b/app/assets/javascripts/supplier/app/models/product_category.js.coffee @@ -10,7 +10,7 @@ App.ProductCategory = DS.Model.extend active_on_thursday: attr('boolean') active_on_friday: attr('boolean') active_on_saturday: attr('boolean') - full_day: attr('boolean') + full_day: attr 'boolean', defaultValue: true start_from: attr('number') end_on: attr('number') position: attr('number') diff --git a/spec/acceptance/suppliers/dashboard.feature b/spec/acceptance/suppliers/dashboard.feature index 9260af75..e73ea89b 100644 --- a/spec/acceptance/suppliers/dashboard.feature +++ b/spec/acceptance/suppliers/dashboard.feature @@ -69,7 +69,6 @@ Feature: Supplier main board Scenario: Selecting a specific section and jumping towards section view Given there is an active list and order And I am signed in as supplier - Then I should not see the supplier main board section jumper When I select the section in the supplier dashboard And I click on the section main board section jumper Then I should be redirected to the supplier section view diff --git a/spec/acceptance/users/changing_table.feature b/spec/acceptance/users/changing_table.feature index 5fe2062a..b9e9ead5 100644 --- a/spec/acceptance/users/changing_table.feature +++ b/spec/acceptance/users/changing_table.feature @@ -8,7 +8,7 @@ Feature: Changing table And there is another table When the user scans a QR code of another not occupied table Then the user should see a popup asking the user if he would like to change table - When the uses indicates in the popup that he wants to change the table + When the user indicates in the popup that he wants to change the table And I wait 1 second Then the user should see the supplier menu having the other table as base And the user list should have been moved to the other table diff --git a/spec/acceptance_steps/suppliers/dashboard_steps.rb b/spec/acceptance_steps/suppliers/dashboard_steps.rb index a004ce30..eeab0faa 100644 --- a/spec/acceptance_steps/suppliers/dashboard_steps.rb +++ b/spec/acceptance_steps/suppliers/dashboard_steps.rb @@ -111,23 +111,23 @@ step "I should see the new list and new order but not the list and order" do end step "I select the section in the supplier dashboard" do - find(%|.section_selector option[value="#{@section.id}"]|).select_option + # find(%|.section_selector option[value="#{@section.id}"]|).select_option + find(%|.sections-header-container [data-section="#{@section.id}"] .section-header-title|).click end step "I select the other section in the supplier dashboard" do - find(%|.section_selector option[value="#{@other_section.id}"]|).select_option + # find(%|.section_selector option[value="#{@other_section.id}"]|).select_option + find(%|.sections-header-container [data-section="#{@other_section.id}"] .section-header-title|).click end step "I reset the section selector in the supplier dashboard" do - find(%|.section_selector option[value=""]|).select_option -end - -step "I should not see the supplier main board section jumper" do - page.should_not have_selector '.main-board-section-jumper' + # find(%|.section_selector option[value=""]|).select_option + find(%|.sections-header-container [data-section="all"] .section-header-title|).click end step "I click on the section main board section jumper" do - find('.main-board-section-jumper').click + # find('.main-board-section-jumper').click + find(%|.sections-header-container [data-section="#{@section.id}"] .section-jumper|).click end step "the active list changes to another table in another section" do @@ -163,5 +163,5 @@ step "the supplier placed orders counter should be reduced" do end step "confirm the supplier close list modal" do - find('.confirm-ok').click + find('.modal-confirm').click end diff --git a/spec/acceptance_steps/users/changing_table_steps.rb b/spec/acceptance_steps/users/changing_table_steps.rb index b57e96d0..309cb33b 100644 --- a/spec/acceptance_steps/users/changing_table_steps.rb +++ b/spec/acceptance_steps/users/changing_table_steps.rb @@ -9,7 +9,7 @@ step "the user should see a popup asking the user if he would like to change tab page.should have_content move_table_body end -step "the uses indicates in the popup that he wants to change the table" do +step "the user indicates in the popup that he wants to change the table" do find('.confirm-ok').click end