Skip to content

Commit fba1c16

Browse files
mamhofftvdeyen
authored andcommitted
Move default customer spec from spec/lib to spec/models
We had two spec files for this functionality.
1 parent af449d9 commit fba1c16

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

core/spec/lib/spree/permission_sets/default_customer_spec.rb

Lines changed: 0 additions & 22 deletions
This file was deleted.

core/spec/models/spree/permission_sets/default_customer_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,21 @@
1515
expect(described_class.category).to eq(:default_customer)
1616
end
1717
end
18+
19+
context 'as Guest User' do
20+
context 'for Order' do
21+
context 'guest_token is empty string' do
22+
let(:ability) { Spree::Ability.new(nil) }
23+
let(:resource) { build(:order) }
24+
let(:token) { '' }
25+
26+
it 'should not be allowed to read or update the order' do
27+
allow(resource).to receive_messages(guest_token: '')
28+
29+
expect(ability).to_not be_able_to(:show, resource, token)
30+
expect(ability).to_not be_able_to(:show, resource, token)
31+
end
32+
end
33+
end
34+
end
1835
end

0 commit comments

Comments
 (0)