Skip to content

Commit

Permalink
Move default customer spec from spec/lib to spec/models
Browse files Browse the repository at this point in the history
We had two spec files for this functionality.
  • Loading branch information
mamhoff authored and tvdeyen committed Jan 24, 2025
1 parent af449d9 commit fba1c16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
22 changes: 0 additions & 22 deletions core/spec/lib/spree/permission_sets/default_customer_spec.rb

This file was deleted.

17 changes: 17 additions & 0 deletions core/spec/models/spree/permission_sets/default_customer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,21 @@
expect(described_class.category).to eq(:default_customer)
end
end

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(:show, resource, token)
expect(ability).to_not be_able_to(:show, resource, token)
end
end
end
end
end

0 comments on commit fba1c16

Please sign in to comment.