Major supplier refactor making the whole system work better
This commit is contained in:
@@ -33,6 +33,7 @@ Feature: Supplier section view
|
||||
And I wait 0.5 seconds
|
||||
|
||||
When I click on the close list button in the section table table popup
|
||||
And confirm the supplier close list modal
|
||||
And I wait 1 second
|
||||
Then the section table should not have any active list markings anymore
|
||||
And the list should be marked as closed
|
||||
|
||||
@@ -21,6 +21,12 @@ step "I wait :number second/seconds" do |number|
|
||||
sleep number.to_f
|
||||
end
|
||||
|
||||
placeholder :number do
|
||||
match /[-+]?\d+(\.\d+)?/ do |number_string|
|
||||
number_string.to_f
|
||||
end
|
||||
end
|
||||
|
||||
step "I open the debugger" do
|
||||
binding.pry
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ step "I visit the supplier section path" do
|
||||
end
|
||||
|
||||
step "I visit the supplier last section path" do
|
||||
visit "/supplier/sections/#{@sections.last.id}"
|
||||
visit "/supplier#/sections/#{@sections.last.id}"
|
||||
end
|
||||
|
||||
step "I should be redirected to the supplier settings page" do
|
||||
@@ -20,5 +20,5 @@ step "I should be redirected to the supplier settings page" do
|
||||
end
|
||||
|
||||
step "I visit the supplier settings path" do
|
||||
visit supplier_settings_path
|
||||
visit "/supplier#/settings"
|
||||
end
|
||||
|
||||
@@ -27,7 +27,6 @@ step "the section table should be marked as in need of help" do
|
||||
end
|
||||
|
||||
step "the section table should not be marked as in need of help" do
|
||||
binding.pry
|
||||
table = page.find(".section-table-#{@table.id}")
|
||||
table['class'].should_not include 'needs_help'
|
||||
end
|
||||
|
||||
@@ -156,4 +156,12 @@ describe List do
|
||||
|
||||
describe 'product order creation'
|
||||
end
|
||||
|
||||
describe '#close!' do
|
||||
it 'removes the helped mark' do
|
||||
list_options[:needs_help] = true
|
||||
list.close!
|
||||
expect( list.needs_help? ).not_to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -153,4 +153,26 @@ describe Order do
|
||||
end
|
||||
end
|
||||
end
|
||||
describe '#close!' do
|
||||
describe 'counters' do
|
||||
before do
|
||||
# hack some initial values
|
||||
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11
|
||||
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7
|
||||
end
|
||||
|
||||
it "decrements the orders_placed_count for when a placed order is closed" do
|
||||
order.close!
|
||||
supplier.orders_placed_count.should == 10
|
||||
supplier.orders_in_process_count.should == 7
|
||||
end
|
||||
|
||||
it "decrements the orders_in_process_count for when an active order is closed" do
|
||||
order_options[:state] = 'active'
|
||||
order.close!
|
||||
supplier.orders_placed_count.should == 11
|
||||
supplier.orders_in_process_count.should == 6
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user