mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Enforce RSpec expect(..).not_to over to_not
This commit is contained in:
@@ -19,15 +19,15 @@ end
|
||||
|
||||
shared_examples_for 'access denied' do
|
||||
it 'should not allow read' do
|
||||
expect(subject).to_not be_able_to(:read, resource)
|
||||
expect(subject).not_to be_able_to(:read, resource)
|
||||
end
|
||||
|
||||
it 'should not allow create' do
|
||||
expect(subject).to_not be_able_to(:create, resource)
|
||||
expect(subject).not_to be_able_to(:create, resource)
|
||||
end
|
||||
|
||||
it 'should not allow update' do
|
||||
expect(subject).to_not be_able_to(:update, resource)
|
||||
expect(subject).not_to be_able_to(:update, resource)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ end
|
||||
|
||||
shared_examples_for 'admin denied' do
|
||||
it 'should not allow admin' do
|
||||
expect(subject).to_not be_able_to(:admin, resource)
|
||||
expect(subject).not_to be_able_to(:admin, resource)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ end
|
||||
|
||||
shared_examples_for 'no index allowed' do
|
||||
it 'should not allow index' do
|
||||
expect(subject).to_not be_able_to(:index, resource)
|
||||
expect(subject).not_to be_able_to(:index, resource)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,25 +62,25 @@ shared_examples_for 'create only' do
|
||||
end
|
||||
|
||||
it 'should not allow read' do
|
||||
expect(subject).to_not be_able_to(:read, resource)
|
||||
expect(subject).not_to be_able_to(:read, resource)
|
||||
end
|
||||
|
||||
it 'should not allow update' do
|
||||
expect(subject).to_not be_able_to(:update, resource)
|
||||
expect(subject).not_to be_able_to(:update, resource)
|
||||
end
|
||||
|
||||
it 'should not allow index' do
|
||||
expect(subject).to_not be_able_to(:index, resource)
|
||||
expect(subject).not_to be_able_to(:index, resource)
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'read only' do
|
||||
it 'should not allow create' do
|
||||
expect(subject).to_not be_able_to(:create, resource)
|
||||
expect(subject).not_to be_able_to(:create, resource)
|
||||
end
|
||||
|
||||
it 'should not allow update' do
|
||||
expect(subject).to_not be_able_to(:update, resource)
|
||||
expect(subject).not_to be_able_to(:update, resource)
|
||||
end
|
||||
|
||||
it 'should allow index' do
|
||||
@@ -90,11 +90,11 @@ end
|
||||
|
||||
shared_examples_for 'update only' do
|
||||
it 'should not allow create' do
|
||||
expect(subject).to_not be_able_to(:create, resource)
|
||||
expect(subject).not_to be_able_to(:create, resource)
|
||||
end
|
||||
|
||||
it 'should not allow read' do
|
||||
expect(subject).to_not be_able_to(:read, resource)
|
||||
expect(subject).not_to be_able_to(:read, resource)
|
||||
end
|
||||
|
||||
it 'should allow update' do
|
||||
@@ -102,7 +102,7 @@ shared_examples_for 'update only' do
|
||||
end
|
||||
|
||||
it 'should not allow index' do
|
||||
expect(subject).to_not be_able_to(:index, resource)
|
||||
expect(subject).not_to be_able_to(:index, resource)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ module AuthenticationHelper
|
||||
|
||||
def expect_logged_in
|
||||
# Ensure page has been reloaded after submitting login form
|
||||
expect(page).to_not have_selector ".menu #login-link"
|
||||
expect(page).to_not have_content "Login"
|
||||
expect(page).not_to have_selector ".menu #login-link"
|
||||
expect(page).not_to have_content "Login"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ module ShopWorkflow
|
||||
within find_body do
|
||||
# We ignore visibility in case the cart dropdown is not open.
|
||||
within '.cart-sidebar', visible: false do
|
||||
expect(page).to_not have_link "Updating cart...", visible: false
|
||||
expect(page).not_to have_link "Updating cart...", visible: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user