mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge branch 'master' into maps
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
-#%pre
|
||||
-#{{ Order.order}}
|
||||
|
||||
.small-12.columns
|
||||
%div
|
||||
%h3.text-center.pad-top
|
||||
Checkout from
|
||||
= current_distributor.name
|
||||
@@ -20,7 +20,8 @@
|
||||
= render partial: "checkout/shipping", locals: {f: f}
|
||||
= render partial: "checkout/payment", locals: {f: f}
|
||||
%p
|
||||
%input.button.primary{type: :submit,
|
||||
value: "Place order now",
|
||||
"ng-click" => "purchase($event)",
|
||||
"ng-show" => "checkout.$valid"}
|
||||
%button.button.primary{type: :submit,
|
||||
"ng-click" => "purchase($event)",
|
||||
"ng-disabled" => "checkout.$invalid"}
|
||||
Place order now
|
||||
/ {{ checkout.$valid }}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
= render partial: "shopping_shared/details"
|
||||
|
||||
%accordion.row{"close-others" => "true"}
|
||||
%checkout{"ng-controller" => "CheckoutCtrl"}
|
||||
%accordion{"close-others" => "true"}
|
||||
%checkout.row{"ng-controller" => "CheckoutCtrl"}
|
||||
.small-9.columns
|
||||
- unless spree_current_user
|
||||
= render partial: "checkout/authentication"
|
||||
|
||||
@@ -21,9 +21,7 @@
|
||||
%h4 Getting around
|
||||
%ul.ofn-list
|
||||
%li
|
||||
%a{href: "/shop"}
|
||||
%i.ofn-i_044-facebook
|
||||
Shop
|
||||
%a{href: "/shop"} Shop
|
||||
%li
|
||||
%a{href: "/map"} Map
|
||||
%li
|
||||
|
||||
@@ -24,13 +24,6 @@
|
||||
%a{href: main_app.groups_path}
|
||||
%span.nav-primary Groups
|
||||
%li.divider
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%span.nav-primary
|
||||
%i.ofn-i_021-tools
|
||||
Admin
|
||||
%li.divider
|
||||
%section.top-bar-section
|
||||
%ul.right
|
||||
%li.divider
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
= validated_input "Card Number", "secrets.card_number", required: true, maxlength: 19, autocomplete: "off"
|
||||
.row
|
||||
.small-6.columns
|
||||
= validated_input "Card Number", "secrets.card_number", required: true, maxlength: 19, autocomplete: "off"
|
||||
.small-6.columns
|
||||
= validated_input "Security Code", "secrets.card_verification_value", required: true
|
||||
|
||||
%label{for: "secrets.card_month"} Expiry Date
|
||||
%select{"ng-model" => "secrets.card_month", "ng-options" => "number as name for (number, name) in months", name: "secrets.card_month", required: true}
|
||||
.row
|
||||
.small-12.columns
|
||||
%label{for: "secrets.card_month"} Expiry Date
|
||||
|
||||
%select{"ng-model" => "secrets.card_year", "ng-options" => "year for year in years", name: "secrets.card_year", required: true}
|
||||
.row
|
||||
.small-6.columns
|
||||
%select{"ng-model" => "secrets.card_month", "ng-options" => "number as name for (number, name) in months", name: "secrets.card_month", required: true}
|
||||
.small-6.columns
|
||||
%select{"ng-model" => "secrets.card_year", "ng-options" => "year for year in years", name: "secrets.card_year", required: true}
|
||||
|
||||
= validated_input "CVV", "secrets.card_verification_value", required: true
|
||||
|
||||
@@ -134,7 +134,7 @@ feature %q{
|
||||
v2 = FactoryGirl.create(:variant, product: p1, is_master: false, on_hand: 0, on_demand: true)
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should_not have_selector "span[name='on_hand']", text: "On demand", visible: true
|
||||
page.should have_field "variant_on_hand", with: "4"
|
||||
@@ -171,7 +171,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
all("a.view-variants").each{ |e| e.click }
|
||||
all("a.view-variants").each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_field "product_name", with: v1.product.name
|
||||
page.should have_field "product_name", with: v2.product.name
|
||||
@@ -185,7 +185,7 @@ feature %q{
|
||||
v2 = FactoryGirl.create(:variant, product: p1, is_master: false, on_hand: 6)
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
all("a.view-variants").each{ |e| e.click }
|
||||
all("a.view-variants").each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_selector "span[name='on_hand']", text: "21"
|
||||
page.should have_field "variant_on_hand", with: "15"
|
||||
@@ -199,7 +199,7 @@ feature %q{
|
||||
v2 = FactoryGirl.create(:variant, product: p1, is_master: false, price: 2.50)
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
all("a.view-variants").each{ |e| e.click }
|
||||
all("a.view-variants").each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_field "price", with: "2.0", visible: false
|
||||
page.should have_field "variant_price", with: "12.75"
|
||||
@@ -212,7 +212,7 @@ feature %q{
|
||||
v2 = FactoryGirl.create(:variant, product: p1, is_master: false, price: 2.50, unit_value: 4800, unit_description: "(large bag)")
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
all("a.view-variants").each{ |e| e.click }
|
||||
all("a.view-variants").each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_field "variant_unit_value_with_description", with: "1.2 (small bag)"
|
||||
page.should have_field "variant_unit_value_with_description", with: "4.8 (large bag)"
|
||||
@@ -260,9 +260,9 @@ feature %q{
|
||||
page.should have_selector 'a.add-variant', visible: true
|
||||
|
||||
# When I add three variants
|
||||
page.find('a.add-variant', visible: true).click
|
||||
page.find('a.add-variant', visible: true).click
|
||||
page.find('a.add-variant', visible: true).click
|
||||
page.find('a.add-variant', visible: true).trigger('click')
|
||||
page.find('a.add-variant', visible: true).trigger('click')
|
||||
page.find('a.add-variant', visible: true).trigger('click')
|
||||
|
||||
# They should be added, and should see no edit buttons
|
||||
page.all("tr.variant").count.should == 3
|
||||
@@ -286,7 +286,7 @@ feature %q{
|
||||
# And the variants should be saved
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should have_field "variant_unit_value_with_description", with: "4000 (12x250 mL bottles)"
|
||||
page.should have_field "variant_price", with: "4.0"
|
||||
@@ -368,14 +368,14 @@ feature %q{
|
||||
page.should have_select "variant_unit_with_scale", selected: ''
|
||||
|
||||
select "Weight (kg)", from: "variant_unit_with_scale"
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
fill_in "variant_unit_value_with_description", with: '123 abc'
|
||||
|
||||
click_button 'Update'
|
||||
page.find("span#update-status-message").should have_content "Update complete"
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should have_select "variant_unit_with_scale", selected: "Weight (kg)"
|
||||
page.should have_field "variant_unit_value_with_description", with: "123 abc"
|
||||
@@ -434,7 +434,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should have_field "variant_price", with: "3.0"
|
||||
page.should have_field "variant_unit_value_with_description", with: "250 (bottle)"
|
||||
@@ -452,7 +452,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should have_field "variant_price", with: "4.0"
|
||||
page.should have_field "variant_on_hand", with: "10"
|
||||
@@ -467,7 +467,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should have_field "variant_price", with: "3.0"
|
||||
|
||||
@@ -478,7 +478,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
first("a.view-variants").click
|
||||
first("a.view-variants").trigger('click')
|
||||
|
||||
page.should have_field "variant_price", with: "10.0"
|
||||
end
|
||||
@@ -596,7 +596,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
all("a.view-variants").each { |e| e.click }
|
||||
all("a.view-variants").each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_selector "a.delete-variant", :count => 3
|
||||
|
||||
@@ -606,7 +606,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
all("a.view-variants").select { |e| e.visible? }.each { |e| e.click }
|
||||
all("a.view-variants").select { |e| e.visible? }.each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_selector "a.delete-variant", :count => 2
|
||||
end
|
||||
@@ -636,7 +636,7 @@ feature %q{
|
||||
|
||||
visit '/admin/products/bulk_edit'
|
||||
page.should have_selector "a.view-variants"
|
||||
all("a.view-variants").each { |e| e.click }
|
||||
all("a.view-variants").each { |e| e.trigger('click') }
|
||||
|
||||
page.should have_selector "a.edit-variant", :count => 3
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
fill_in 'Card Number', with: "4111111111111111"
|
||||
select 'February', from: 'secrets.card_month'
|
||||
select (Date.today.year+1).to_s, from: 'secrets.card_year'
|
||||
fill_in 'CVV', with: '123'
|
||||
fill_in 'Security Code', with: '123'
|
||||
|
||||
place_order
|
||||
page.should have_content "Your order has been processed successfully"
|
||||
|
||||
Reference in New Issue
Block a user