summaryrefslogtreecommitdiff
path: root/spec/lib/solidus_subscriptions/ability_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/solidus_subscriptions/ability_spec.rb')
-rw-r--r--spec/lib/solidus_subscriptions/ability_spec.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/lib/solidus_subscriptions/ability_spec.rb b/spec/lib/solidus_subscriptions/ability_spec.rb
index 5e2903d..f27c15c 100644
--- a/spec/lib/solidus_subscriptions/ability_spec.rb
+++ b/spec/lib/solidus_subscriptions/ability_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe SolidusSubscriptions::Ability do
create :subscription_line_item, order: order
end
- it { should be_able_to :crud, line_item, order }
+ it { is_expected.to be_able_to :crud, line_item, order }
end
context 'doesnt own the order' do
@@ -24,30 +24,31 @@ RSpec.describe SolidusSubscriptions::Ability do
create :subscription_line_item, order: order
end
- it { should_not be_able_to :crud, line_item, another_order }
+ it { is_expected.not_to be_able_to :crud, line_item, another_order }
end
context 'the user owns a subscription' do
let(:subscription) { create :subscription, user: user }
- it { should be_able_to :crud, subscription }
- it { should be_able_to :skip, subscription }
- it { should be_able_to :cancel, subscription }
+
+ it { is_expected.to be_able_to :crud, subscription }
+ it { is_expected.to be_able_to :skip, subscription }
+ it { is_expected.to be_able_to :cancel, subscription }
end
context 'the doesnt own a subscription' do
let(:another_user) { create :user }
let(:subscription) { create :subscription, user: another_user }
- it { should_not be_able_to :crud, subscription }
- it { should_not be_able_to :skip, subscription }
- it { should_not be_able_to :cancel, subscription }
+ it { is_expected.not_to be_able_to :crud, subscription }
+ it { is_expected.not_to be_able_to :skip, subscription }
+ it { is_expected.not_to be_able_to :cancel, subscription }
end
end
context 'the user is an admin' do
let(:user) { create :admin_user }
- it { should be_able_to :manage, SolidusSubscriptions::Subscription }
- it { should be_able_to :manage, SolidusSubscriptions::LineItem }
+ it { is_expected.to be_able_to :manage, SolidusSubscriptions::Subscription }
+ it { is_expected.to be_able_to :manage, SolidusSubscriptions::LineItem }
end
end