mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Listing more attributes of orders on BOM page
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
%thead
|
||||
%tr
|
||||
%th ID
|
||||
%th Email
|
||||
%th Order Date
|
||||
%tbody{ 'ng-repeat' => 'order in orders', 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'" }
|
||||
%tr.order
|
||||
%td.id {{ order.id }}
|
||||
%td.id {{ order.id }}
|
||||
%td.email {{ order.email }}
|
||||
%td.date {{ order.completed_at }}
|
||||
@@ -6,21 +6,21 @@ feature %q{
|
||||
} , js: true do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
|
||||
|
||||
before :all do
|
||||
@default_wait_time = Capybara.default_wait_time
|
||||
Capybara.default_wait_time = 5
|
||||
end
|
||||
|
||||
|
||||
after :all do
|
||||
Capybara.default_wait_time = @default_wait_time
|
||||
end
|
||||
|
||||
describe "listing orders" do
|
||||
context "listing orders" do
|
||||
before :each do
|
||||
login_to_admin_section
|
||||
end
|
||||
|
||||
|
||||
it "displays a Bulk Management Tab under the Orders item" do
|
||||
visit '/admin/orders'
|
||||
|
||||
@@ -29,14 +29,31 @@ feature %q{
|
||||
page.should have_selector "h1.page-title", text: "Bulk Order Management"
|
||||
end
|
||||
|
||||
it "displays a list of orders" do
|
||||
o1 = FactoryGirl.create(:order, state: 'complete', completed_at: Time.now)
|
||||
o2 = FactoryGirl.create(:order, state: 'complete', completed_at: Time.now)
|
||||
context "displaying individual columns" do
|
||||
let!(:o1) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now ) }
|
||||
let!(:o2) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now ) }
|
||||
|
||||
visit '/admin/orders/bulk_management'
|
||||
before :each do
|
||||
visit '/admin/orders/bulk_management'
|
||||
end
|
||||
|
||||
page.should have_selector "td", text: o1.id.to_s, :visible => true
|
||||
page.should have_selector "td", text: o2.id.to_s, :visible => true
|
||||
it "displays a list of orders" do
|
||||
page.should have_selector "th", text: "ID", :visible => true
|
||||
page.should have_selector "td", text: o1.id.to_s, :visible => true
|
||||
page.should have_selector "td", text: o2.id.to_s, :visible => true
|
||||
end
|
||||
|
||||
it "displays a column for user email" do
|
||||
page.should have_selector "th", text: "EMAIL", :visible => true
|
||||
page.should have_selector "td", text: o1.email, :visible => true
|
||||
page.should have_selector "td", text: o2.email, :visible => true
|
||||
end
|
||||
|
||||
it "displays a column for order date" do
|
||||
page.should have_selector "th", text: "ORDER DATE", :visible => true
|
||||
page.should have_selector "td", text: o1.completed_at.strftime("%F %T"), :visible => true
|
||||
page.should have_selector "td", text: o2.completed_at.strftime("%F %T"), :visible => true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user