Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if user_id is already set (with regression spec) #2176

Merged
merged 1 commit into from Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -53,7 +53,7 @@ Spree.Views.Order.CustomerDetails = Backbone.View.extend({
},

render: function() {
var user_id = this.model.get("user_id")
var user_id = this.model.get("user_id") || $("#user_id").val()
this.$("#user_id").val(user_id);
this.$('#guest_checkout_true')
.prop("checked", !user_id);
Expand All @@ -65,4 +65,3 @@ Spree.Views.Order.CustomerDetails = Backbone.View.extend({
this.$('#order_email').val(this.model.get("email"))
}
})

7 changes: 7 additions & 0 deletions backend/spec/features/admin/orders/customer_details_spec.rb
Expand Up @@ -48,6 +48,13 @@
expect(Spree::Order.last.user).not_to be_nil
end

# Regression test for https://github.com/solidusio/solidus/pull/2176
it "does not reset guest checkout to true when returning to customer tab" do
click_button "Update"
click_link "Customer"
expect(find('#guest_checkout_true')).not_to be_checked
end

context "when required quantity is more than available" do
let(:quantity) { 11 }
let!(:product) { create(:product_not_backorderable) }
Expand Down