From c915bb91cfd86b958dd6907f82cef78a6e005065 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 7 Aug 2013 16:03:00 +1000 Subject: [PATCH] More tests for distributor enterprise user roles --- spec/models/ability_spec.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 077147d514..b757eb744e 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -92,6 +92,26 @@ module Spree it "should not be able to read/write other enterprises' orders" do should_not have_ability([:admin, :index, :read, :edit], for: o2) end + + it "should be able to create a new order" do + should have_ability(:create, for: Spree::Order) + end + + it "should be able to read/write Payments on a product" do + should have_ability([:admin, :index, :read, :create, :edit, :update, :fire], for: Spree::Payment) + end + + it "should be able to read/write Shipments on a product" do + should have_ability([:admin, :index, :read, :create, :edit, :update, :fire], for: Spree::Shipment) + end + + it "should be able to read/write Adjustments on a product" do + should have_ability([:admin, :index, :read, :create, :edit, :update, :fire], for: Spree::Adjustment) + end + + it "should be able to read/write ReturnAuthorizations on a product" do + should have_ability([:admin, :index, :read, :create, :edit, :update, :fire], for: Spree::ReturnAuthorization) + end end end