67 lines
2.2 KiB
Ruby
67 lines
2.2 KiB
Ruby
step "the section table should be positioned in the section" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
left = table['style'].to_s.match(/left:(\d+)/)
|
|
left.should be_present
|
|
left[1].to_i.should > 10
|
|
top = table['style'].to_s.match(/top:(\d+)/)
|
|
top.should be_present
|
|
top[1].to_i.should > 10
|
|
end
|
|
|
|
step "the section table should be marked as having an active order" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
table['class'].should include 'active_order'
|
|
end
|
|
|
|
step "the section table should be marked as occupied" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
table['class'].should include 'occupied'
|
|
end
|
|
|
|
step "the section table should be marked as in need of help" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
table['class'].should include 'needs_help'
|
|
end
|
|
|
|
step "the section table should not be marked as in need of help" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
table['class'].should_not include 'needs_help'
|
|
end
|
|
|
|
step "I click on section table as a supplier" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
table.click
|
|
end
|
|
|
|
step "the section table should be marked as in need of payment" do
|
|
page.should have_selector(".section-table-#{@table.id}.needs_payment")
|
|
end
|
|
|
|
step "A popup having table options should appear in supplier section area" do
|
|
page.should have_selector(".table-actions-#{@table.id}")
|
|
end
|
|
|
|
step "I click on the mark list as helped in the section table popup as supplier" do
|
|
btn = page.find(".list-is-helped-button-#{@list.id}")
|
|
btn.click
|
|
end
|
|
|
|
step "the section table popup should no longer have the mark list as helped button" do
|
|
page.should_not have_selector(".list-is-helped-button-#{@list.id}")
|
|
end
|
|
|
|
step "I click on the close list button in the section table table popup" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
table.click
|
|
page.find(".table-actions-#{@table.id} .close-list").click
|
|
end
|
|
|
|
step "the section table should not have any active list markings anymore" do
|
|
table = page.find(".section-table-#{@table.id}")
|
|
css_class = table['class']
|
|
css_class.should_not include 'needs_help'
|
|
css_class.should_not include 'occupied'
|
|
css_class.should_not include 'active_order'
|
|
css_class.should_not include 'needs_payment'
|
|
end
|