Skip to content

Commit

Permalink
Merge branch 'delivery-date-sort-wrong-3478-3479'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Barreca committed Nov 7, 2018
2 parents 11da51d + 5ef04ba commit cae0a75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions spec/lib/user_delivery_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
describe ".build(user:,delivery:)" do
include_context "the mini market"

let(:delivery) {create(:delivery,
delivery_schedule: mm_delivery_schedule,
orders: [ mm_order ])}
let(:delivery) {create(:delivery,
delivery_schedule: mm_delivery_schedule,
orders: [ mm_order1 ])}

it "correctly sets is_admin" do
c = UserDeliveryContext.build(user: barry, delivery: delivery)
Expand All @@ -31,7 +31,7 @@
c = UserDeliveryContext.build(user: sally, delivery: delivery)
expect(c.is_seller).to eq true
end

it "correctly sets is_buyer_only" do
c = UserDeliveryContext.build(user: mary, delivery: delivery)
expect(c.is_buyer_only).to eq false
Expand All @@ -51,6 +51,6 @@
expect(c.packing_labels_feature).to eq true
end


end
end
26 changes: 13 additions & 13 deletions spec/lib/user_order_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,56 @@
include_context "the mini market"

it "correctly sets is_admin" do
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.is_admin).to eq false
c = UserOrderContext.build(user:aaron, order:mm_order)
c = UserOrderContext.build(user:aaron, order:mm_order1)
expect(c.is_admin).to eq true
end

it "correctly sets is_market_manager" do
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.is_market_manager).to eq false
c = UserOrderContext.build(user:mary, order:mm_order)
c = UserOrderContext.build(user:mary, order:mm_order1)
expect(c.is_market_manager).to eq true
end

it "correctly sets is_seller" do
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.is_seller).to eq true
c = UserOrderContext.build(user:mary, order:mm_order)
c = UserOrderContext.build(user:mary, order:mm_order1)
expect(c.is_seller).to eq false
end

it "correctly sets the seller_organization field" do
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.seller_organization).to eq seller_organization

c = UserOrderContext.build(user:mary, order:mm_order)
c = UserOrderContext.build(user:mary, order:mm_order1)
expect(c.seller_organization).to eq nil

c = UserOrderContext.build(user:barry, order:mm_order)
c = UserOrderContext.build(user:barry, order:mm_order1)
expect(c.seller_organization).to eq nil
end

it "correctly sets the feature availability" do
mini_market_plan.update(sellers_edit_orders: true)
mini_market.update(sellers_edit_orders: true)
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.sellers_edit_orders_feature).to eq true

mini_market_plan.update(sellers_edit_orders: false)
mini_market.update(sellers_edit_orders: true)
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.sellers_edit_orders_feature).to eq false

mini_market_plan.update(sellers_edit_orders: true)
mini_market.update(sellers_edit_orders: false)
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.sellers_edit_orders_feature).to eq false

mini_market_plan.update(sellers_edit_orders: false)
mini_market.update(sellers_edit_orders: false)
c = UserOrderContext.build(user:sally, order:mm_order)
c = UserOrderContext.build(user:sally, order:mm_order1)
expect(c.sellers_edit_orders_feature).to eq false
end

Expand Down

0 comments on commit cae0a75

Please sign in to comment.