Sha256: 85b05ce44f21d9cf66314b375c614f7391c2d5a9975b49dcb5b86f219e80a1f4

Contents?: true

Size: 611 Bytes

Versions: 11

Compression:

Stored size: 611 Bytes

Contents

require 'rails_helper'

RSpec.describe Spree::PermissionSets::DefaultCustomer do
  context 'as Guest User' do
    context 'for Order' do
      context 'guest_token is empty string' do
        let(:ability) { Spree::Ability.new(nil) }
        let(:resource) { build(:order) }
        let(:token) { '' }

        it 'should not be allowed to read or update the order' do
          allow(resource).to receive_messages(guest_token: '')

          expect(ability).to_not be_able_to(:read, resource, token)
          expect(ability).to_not be_able_to(:update, resource, token)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
solidus_core-2.5.2 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.5.1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.5.0 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.5.0.rc1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.5.0.beta2 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.5.0.beta1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.4.2 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.4.1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.4.0 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.4.0.rc1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.4.0.beta1 spec/lib/spree/permission_sets/default_customer_spec.rb