Permalink
Browse files

Fix tests and remove duplicate features

  • Loading branch information...
1 parent 9d41a6b commit 2ee8205894656b880778493c4f3948da5f47b7c7 @BDQ BDQ committed Aug 22, 2011
@@ -2,51 +2,51 @@ Feature: Admin visiting orders listing
Scenario: orders listing
Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2011-02-01 12:36:15 | R200 |
+ |created at | completed at | number |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 |
And I go to the admin home page
Then I should see row 1 and column 2 to have value "cart" with selector "table#listing_orders"
Then I should see row 1 and column 1 to have value "R100" with selector "table#listing_orders"
Scenario: orders listing with sorting
Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2010-02-01 17:36:42 | R200 |
+ |created at | completed at | number |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 |
And I go to the admin home page
- Then I should see listing orders tabular attributes with created_at descending
- When I follow "Order Date"
- Then I should see listing orders tabular attributes with created_at ascending
+ Then I should see listing orders tabular attributes with completed_at descending
+ When I follow "Completed At"
+ Then I should see listing orders tabular attributes with completed_at ascending
When I follow "Order" within "#listing_orders"
Then I should see listing orders tabular attributes with order number ascending
Scenario: orders search
Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2011-02-01 12:36:15 | R200 |
+ |created at | completed at | number |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 |
And I go to the admin home page
When I fill in "search_number_like" with "R200"
When I press "Search"
Then I should see row 1 and column 1 to have value "R200" with selector "table#listing_orders"
Scenario: Search orders with only completed at input
Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2010-02-01 17:36:42 | R200 |
+ |created at | completed at | number |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 |
+ |2010-01-01 12:36:15 | 2010-01-01 12:36:15 | R200 |
And I go to the admin home page
When I fill in "search_created_at_greater_than" with "2011/01/01"
And I press "Search"
Then I should see listing orders tabular attributes with search result 1
Scenario: Search orders with completed at and first name
Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2011-02-01 12:36:15 | R101 |
- |2010-02-01 17:36:42 | R200 |
+ |created at | completed at | number |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 |
+ |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 |
+ |2010-02-01 17:36:42 | 2010-02-01 17:36:42 | R300 |
Given the custom address exists for the given orders
And I go to the admin home page
When I fill in "search_created_at_greater_than" with "2011/01/01"
@@ -1,40 +1,5 @@
Feature: Admin visiting orders
- Scenario: Visiting orders details page
- Given the following orders exist:
- |created at |
- |2011-02-01 12:36:15 |
- |2010-02-01 17:36:42 |
- And I go to the admin home page
- Then I should see listing orders tabular attributes with created_at descending
- When I follow "Order Date"
- Then I should see listing orders tabular attributes with created_at ascending
- When I follow "Order" within "#listing_orders"
- Then I should see listing orders tabular attributes with order number ascending
-
- Scenario: Search orders with only completed at input
- Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2010-02-01 17:36:42 | R200 |
- And I go to the admin home page
- When I fill in "search_created_at_greater_than" with "2011/01/01"
- And I press "Search"
- Then I should see listing orders tabular attributes with search result 1
-
- Scenario: Search orders with completed at and first name
- Given the following orders exist:
- |created at | number |
- |2011-02-01 12:36:15 | R100 |
- |2011-02-01 12:36:15 | R101 |
- |2010-02-01 17:36:42 | R200 |
- Given the custom address exists for the given orders
- And I go to the admin home page
- When I fill in "search_created_at_greater_than" with "2011/01/01"
- When I fill in "search_bill_address_firstname_starts_with" with "joh"
- And I press "Search"
- Then I should see listing orders tabular attributes with search result 2
-
Scenario: creating new order
Given the following orders exist:
|completed at |
@@ -71,4 +36,3 @@ Feature: Admin visiting orders
Given a product exists with a sku of "a100"
When I follow "admin_new_order"
Then I should see "Add Product" within "#add-line-item"
-
@@ -1,7 +1,7 @@
Then /^I should see listing orders tabular attributes with created_at descending$/ do
output = tableish('table#listing_orders tr', 'td,th')
data = output[0]
- data[0].should match(/Order Date/)
+ data[0].should match(/Completed At/)
data[1].should == "Order"
data[2].should == "Status"
data[3].should == "Payment State"
@@ -10,12 +10,33 @@
data[6].should == "Total"
data = output[1]
- data[0].should == Order.limit(1).order('created_at desc').to_a.first.created_at.strftime('%Y-%m-%d')
+ data[0].should == Order.limit(1).order('completed_at desc').to_a.first.created_at.strftime('%Y-%m-%d')
end
Then /^I should see listing orders tabular attributes with created_at ascending$/ do
output = tableish('table#listing_orders tr', 'td,th')
data = output[1]
+ data[0].should == Order.limit(1).order('completed_at asc').to_a.first.created_at.strftime('%Y-%m-%d')
+end
+
+Then /^I should see listing orders tabular attributes with completed_at descending$/ do
+ output = tableish('table#listing_orders tr', 'td,th')
+ data = output[0]
+ data[0].should match(/Completed At/)
+ data[1].should == "Order"
+ data[2].should == "Status"
+ data[3].should == "Payment State"
+ data[4].should == "Shipment State"
+ data[5].should == "Customer"
+ data[6].should == "Total"
+
+ data = output[1]
+ data[0].should == Order.limit(1).order('created_at desc').to_a.first.created_at.strftime('%Y-%m-%d')
+end
+
+Then /^I should see listing orders tabular attributes with completed_at ascending$/ do
+ output = tableish('table#listing_orders tr', 'td,th')
+ data = output[1]
data[0].should == Order.limit(1).order('created_at asc').to_a.first.created_at.strftime('%Y-%m-%d')
end

0 comments on commit 2ee8205

Please sign in to comment.