Adding specs for variable weight adjustment via builk order management

This commit is contained in:
Lynne Davis
2015-04-04 17:44:02 +01:00
parent bf44a1c862
commit ffd850c761
3 changed files with 76 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ feature %q{
end
it "displays a column for order date" do
page.should have_selector "th,date", text: "ORDER DATE", :visible => true
page.should have_selector "th.date", text: "ORDER DATE", :visible => true
page.should have_selector "td.date", text: o1.completed_at.strftime("%F %T"), :visible => true
page.should have_selector "td.date", text: o2.completed_at.strftime("%F %T"), :visible => true
end
@@ -141,8 +141,22 @@ feature %q{
admin_user = quick_login_as_admin
end
let!(:p1) { FactoryGirl.create(:product_with_option_types, group_buy: true, group_buy_unit_size: 5000, variant_unit: "weight", variants: [FactoryGirl.create(:variant, unit_value: 1000)] ) }
let!(:v1) { p1.variants.first }
let!(:o1) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now ) }
let!(:li1) { FactoryGirl.create(:line_item, order: o1, :quantity => 5 ) }
let!(:li1) { FactoryGirl.create(:line_item, order: o1, variant: v1, :quantity => 5, :unit_value => 1000 ) }
context "modifying the weight/volume of a line item" do
it "update-pending is added to variable 'price'" do
visit '/admin/orders/bulk_management'
first("div#columns_dropdown", :text => "COLUMNS").click
first("div#columns_dropdown div.menu div.menu_item", text: "Weight/Volume").click
page.should_not have_css "input[name='price'].update-pending"
li1_unit_value_column = find("tr#li_#{li1.id} td.unit_value")
li1_unit_value_column.fill_in "unit_value", :with => 1200
page.should have_css "input[name='price'].update-pending", :visible => false
end
end
context "using column display toggle" do
it "shows a column display toggle button, which shows a list of columns when clicked" do