Sha256: e129bafc58997c91f739a51c36c6ab2406fd52590df3436e96ea3ce7deadc8a8

Contents?: true

Size: 642 Bytes

Versions: 48

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

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

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.8.4 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.8.3 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.7.2 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.6.4 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.8.2 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.8.1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.6.3 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.8.0 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.7.1 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core-2.6.2 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.14 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.13 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.12 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.11 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.10 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.9 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.8 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.7 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.6 spec/lib/spree/permission_sets/default_customer_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.5 spec/lib/spree/permission_sets/default_customer_spec.rb