Enforce RSpec expect(..).not_to over to_not

This commit is contained in:
Maikel Linke
2024-03-07 16:57:54 +11:00
parent b4385623b2
commit bd6b0ddbf3
163 changed files with 616 additions and 613 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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