All specs green, ember transition successful

This commit is contained in:
2014-06-27 14:52:18 +02:00
parent a5e8d38882
commit b5a68e9627
19 changed files with 100 additions and 14 deletions
@@ -11,6 +11,9 @@ Feature: Supplier section view
And the section table should be marked as occupied
And the section table should not be marked as in need of help
When the order gets marked as being in process
Then the section table should still be marked as having an active order
When the list is marked as in need of help
# waiting here only needed in old style implementation
And I wait 1 second
+4
View File
@@ -23,6 +23,10 @@ step "the user order should be created as a new order" do
end
step "the user order gets marked as being in process" do
step "the order gets marked as being in process"
end
step "the order gets marked as being in process" do
@order.is_being_processed!
end
@@ -134,7 +134,6 @@ step "the active list changes to another table in another section" do
end
step "the supplier main board table number should be updated to the new table number" do
binding.pry
expect( find(".list-row-#{@list.id} .table_number").text ).to eq "65"
expect( find(".order-row-#{@list.orders.first.id} .table_number").text ).to eq "65"
end
@@ -10,9 +10,11 @@ end
step "the section table should be marked as having an active order" do
table = page.find(".section-table-#{@table.id}")
binding.pry
table['class'].should include 'active_order'
end
step "the section table should still be marked as having an active order" do
step "the section table should be marked as having an active order"
end
step "the section table should be marked as occupied" do
table = page.find(".section-table-#{@table.id}")
+1
View File
@@ -67,6 +67,7 @@ RSpec.configure do |config|
config.include Matchers
config.include Features::BasicHelpers, type: :feature
config.include SpecRouteHelpers, type: :feature
config.include SpecEmberHelpers, type: :feature
#config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = true
config.filter_run_excluding broken: true
+17
View File
@@ -0,0 +1,17 @@
module SpecEmberHelpers
def ember_store
h = page.evaluate_script <<-SCRIPT
$s = Qsupplier.App.__container__.lookup('controller:application').store;
JSON.stringify({
lists: $s.all('list').invoke('serialize'),
orders: $s.all('order').invoke('serialize'),
product_orders: $s.all('product_order').invoke('serialize'),
product_categories: $s.all('product_category').invoke('serialize'),
products: $s.all('product').invoke('serialize'),
sections: $s.all('section').invoke('serialize'),
tables: $s.all('table').invoke('serialize')
})
SCRIPT
JSON.parse(h)
end
end