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

@@ -178,8 +178,8 @@ describe '
it "displays adjustments" do
click_link 'Adjustments'
expect(page).to_not have_selector 'tr a.icon-edit'
expect(page).to_not have_selector 'a.icon-plus', text: 'New Adjustment'
expect(page).not_to have_selector 'tr a.icon-edit'
expect(page).not_to have_selector 'a.icon-plus', text: 'New Adjustment'
end
end
end

View File

@@ -139,7 +139,7 @@ describe '
expect(page).to have_button("« First", disabled: true)
expect(page).to have_button("Previous", disabled: true)
expect(page).to have_button("1", disabled: true)
expect(page).to_not have_button("2")
expect(page).not_to have_button("2")
expect(page).to have_button("Next", disabled: true)
expect(page).to have_button("Last »", disabled: true)
select2_select "100 per page", from: "autogen4" # should display all 20 line items
@@ -1105,7 +1105,7 @@ describe '
end
expect(page).to have_selector "a.delete-line-item", count: 1
expect(o2.reload.state).to eq("canceled")
end.to_not have_enqueued_mail(Spree::OrderMailer, :cancel_email)
end.not_to have_enqueued_mail(Spree::OrderMailer, :cancel_email)
end
it "the user can confirm + wants to send email confirmation : line item is " \
@@ -1123,7 +1123,7 @@ describe '
it "the user can confirm + uncheck the restock option: line item is then deleted and " \
"order is canceled without retocking" do
expect_any_instance_of(Spree::StockLocation).to_not receive(:restock)
expect_any_instance_of(Spree::StockLocation).not_to receive(:restock)
expect do
within(".modal") do
uncheck("Restock Items: return all items to stock")

View File

@@ -102,7 +102,7 @@ describe 'Customers' do
text: 'Delete failed: This customer has ' \
'active subscriptions. Cancel them first.'
click_button "OK"
}.to_not change{ Customer.count }
}.not_to change{ Customer.count }
expect{
within "tr#c_#{customer2.id}" do
@@ -153,8 +153,8 @@ describe 'Customers' do
expect(page).to have_content "$-99.00"
end
within "tr#c_#{customer4.id}" do
expect(page).to_not have_content "CREDIT OWED"
expect(page).to_not have_content "BALANCE DUE"
expect(page).not_to have_content "CREDIT OWED"
expect(page).not_to have_content "BALANCE DUE"
expect(page).to have_content "$0.00"
end
end
@@ -370,7 +370,7 @@ describe 'Customers' do
first('#bill-address-link').click
expect(page).to have_content 'Edit Billing Address'
expect(page).to_not have_content 'Please input all of the required fields'
expect(page).not_to have_content 'Please input all of the required fields'
end
it 'creates a new shipping address' do
@@ -436,7 +436,7 @@ describe 'Customers' do
click_button 'Add Customer'
expect(page).to have_selector "#new-customer-dialog .error",
text: "Please enter a valid email address"
}.to_not change{ Customer.of(managed_distributor1).count }
}.not_to change{ Customer.of(managed_distributor1).count }
# When an invalid email with domain is used it's checked by "valid_email2" gem #7886
expect{
@@ -444,7 +444,7 @@ describe 'Customers' do
click_button 'Add Customer'
expect(page).to have_selector "#new-customer-dialog .error",
text: "Email is invalid"
}.to_not change{ Customer.of(managed_distributor1).count }
}.not_to change{ Customer.of(managed_distributor1).count }
# When a new valid email is used
expect{

View File

@@ -153,7 +153,7 @@ describe '
# editing to an invalid combination
select 'Flat Rate (per order)', from: "#{prefix}_calculator_type"
expect{ click_button 'Update' }.to_not change { fee.reload.calculator_type }
expect{ click_button 'Update' }.not_to change { fee.reload.calculator_type }
expect(page).to have_content "Inheriting the tax categeory requires a per-item calculator."
end
end

View File

@@ -16,7 +16,7 @@ describe "Connected Apps", feature: :connected_apps, vcr: true do
# removing one day.
Flipper.disable(:connected_apps)
visit edit_admin_enterprise_path(enterprise)
expect(page).to_not have_content "CONNECTED APPS"
expect(page).not_to have_content "CONNECTED APPS"
Flipper.enable(:connected_apps, enterprise.owner)
visit edit_admin_enterprise_path(enterprise)
@@ -36,18 +36,18 @@ describe "Connected Apps", feature: :connected_apps, vcr: true do
expect(page).to have_content "Discover Regenerative"
click_button "Allow data sharing"
expect(page).to_not have_button "Allow data sharing"
expect(page).not_to have_button "Allow data sharing"
expect(page).to have_button "Loading", disabled: true
perform_enqueued_jobs(only: ConnectAppJob)
expect(page).to_not have_button "Loading", disabled: true
expect(page).not_to have_button "Loading", disabled: true
expect(page).to have_content "account is connected"
expect(page).to have_link "Manage listing"
click_button "Stop sharing"
expect(page).to have_button "Allow data sharing"
expect(page).to_not have_button "Stop sharing"
expect(page).to_not have_content "account is connected"
expect(page).to_not have_link "Manage listing"
expect(page).not_to have_button "Stop sharing"
expect(page).not_to have_content "account is connected"
expect(page).not_to have_link "Manage listing"
end
end

View File

@@ -93,9 +93,9 @@ describe 'Enterprises Index' do
"#{manager.email} is not permitted to own any more enterprises (limit is 1)."
)
second_distributor.reload
}.to_not change { second_distributor.owner }
}.not_to change { second_distributor.owner }
expect(second_distributor.owner).to_not eq manager
expect(second_distributor.owner).not_to eq manager
end
def select_new_owner(user, enterprise)

View File

@@ -50,7 +50,7 @@ describe "Uploading Terms and Conditions PDF" do
click_button "Update"
expect(page).
to have_content "Enterprise \"#{distributor.name}\" has been successfully updated!"
expect(distributor.reload.terms_and_conditions_blob.created_at).to_not eq run_time
expect(distributor.reload.terms_and_conditions_blob.created_at).not_to eq run_time
go_to_business_details
expect(page).to have_selector "a[href*='Terms-of-ServiceUK.pdf']"

View File

@@ -588,7 +588,7 @@ describe '
expect do
click_button "Invite"
expect(page).to have_content "Email is invalid"
end.to_not enqueue_job ActionMailer::MailDeliveryJob
end.not_to enqueue_job ActionMailer::MailDeliveryJob
end
end
@@ -600,7 +600,7 @@ describe '
expect do
click_button "Invite"
expect(page).to have_content "User already exists"
end.to_not enqueue_job ActionMailer::MailDeliveryJob
end.not_to enqueue_job ActionMailer::MailDeliveryJob
end
end
@@ -698,7 +698,7 @@ describe '
end
expect(flash_message).to match(/Logo removed/)
distributor1.reload
expect(distributor1.white_label_logo).to_not be_attached
expect(distributor1.white_label_logo).not_to be_attached
end
shared_examples "edit link with" do |url, result|

View File

@@ -6,7 +6,7 @@ describe "OIDC Settings" do
it "requires login" do
visit admin_oidc_settings_path
expect(page).to have_button "Login"
expect(page).to_not have_button "Link your Les Communs OIDC Account"
expect(page).not_to have_button "Link your Les Communs OIDC Account"
end
describe "with valid login" do
@@ -36,7 +36,7 @@ describe "OIDC Settings" do
expect(page).to have_content "Tokens to access connected apps have expired"
click_button "Refresh authorisation"
expect(page).to_not have_content "Tokens to access connected apps have expired"
expect(page).not_to have_content "Tokens to access connected apps have expired"
end
end
end

View File

@@ -26,7 +26,7 @@ describe '
expect(page).to have_selector ".exchange-product-details"
expect(page).to have_content "1 of 2 Variants Loaded"
expect(page).to_not have_content new_product.name
expect(page).not_to have_content new_product.name
end
it "load all products" do

View File

@@ -207,7 +207,7 @@ describe '
# I should see only the order cycle I am coordinating
expect(page).to have_selector "tr.order-cycle-#{oc_user_coordinating.id}"
expect(page).to_not have_selector "tr.order-cycle-#{oc_for_other_user.id}"
expect(page).not_to have_selector "tr.order-cycle-#{oc_for_other_user.id}"
toggle_columns "Producers", "Shops"
@@ -263,7 +263,7 @@ describe '
click_button 'Save and Next'
expect(page).to have_content 'Your order cycle has been updated.'
expect(page).to_not have_content "Loading..."
expect(page).not_to have_content "Loading..."
expect(page).to have_select 'new_distributor_id'
expect(page).not_to have_select 'new_distributor_id',
@@ -578,7 +578,7 @@ describe '
expect(page).to have_selector "tr.supplier-#{supplier_managed.id}"
expect(page).to have_selector 'tr.supplier', count: 1
expect(page).to_not have_content "Loading..."
expect(page).not_to have_content "Loading..."
# Open the products list for managed_supplier's incoming exchange
within "tr.supplier-#{supplier_managed.id}" do
@@ -847,7 +847,7 @@ describe '
accept_alert do
first('a.delete-order-cycle').click
end
expect(page).to_not have_selector "tr.order-cycle-#{order_cycle.id}"
expect(page).not_to have_selector "tr.order-cycle-#{order_cycle.id}"
end
private

View File

@@ -210,7 +210,7 @@ describe '
end
expect(page).to have_content "Cannot add item to canceled order"
expect(order.reload.state).to eq("canceled")
end.to_not have_enqueued_mail(Spree::OrderMailer, :cancel_email)
end.not_to have_enqueued_mail(Spree::OrderMailer, :cancel_email)
end
it "and the items are not restocked when the user uncheck the checkbox to restock items" do
@@ -359,7 +359,7 @@ describe '
within("tr.stock-item", text: order.products.first.name) do
expect(page).to have_field :quantity, with: max_quantity.to_s
end
expect { item.reload }.to_not change { item.quantity }
expect { item.reload }.not_to change { item.quantity }
end
it "there are infinite items available (variant is on demand)" do
@@ -430,7 +430,7 @@ describe '
find("button.add_variant").click
end
expect(page).to_not have_selector("table.stock-levels")
expect(page).not_to have_selector("table.stock-levels")
expect(page).to have_selector("table.stock-contents")
within("tr.stock-item") do
@@ -752,7 +752,7 @@ describe '
it "can edit shipping method" do
visit spree.edit_admin_order_path(order)
expect(page).to_not have_content different_shipping_method_for_distributor1.name
expect(page).not_to have_content different_shipping_method_for_distributor1.name
find('.edit-method').click
expect(page).to have_select2('selected_shipping_rate_id',
@@ -857,7 +857,7 @@ describe '
it "can edit and delete tracking number" do
test_tracking_number = "ABCCBA"
expect(page).to_not have_content test_tracking_number
expect(page).not_to have_content test_tracking_number
find('.edit-tracking').click
fill_in "tracking", with: test_tracking_number
@@ -871,18 +871,18 @@ describe '
# the alert box vanishes and tracking num is still present
expect(page).to have_content 'Are you sure?'
find('.cancel').click
expect(page).to_not have_content 'Are you sure?'
expect(page).not_to have_content 'Are you sure?'
expect(page).to have_content test_tracking_number
find('.delete-tracking.icon-trash').click
expect(page).to have_content 'Are you sure?'
find('.confirm').click
expect(page).to_not have_content test_tracking_number
expect(page).not_to have_content test_tracking_number
end
it "can edit and delete note" do
test_note = "this is a note"
expect(page).to_not have_content test_note
expect(page).not_to have_content test_note
find('.edit-note.icon-edit').click
fill_in "note", with: test_note
@@ -896,13 +896,13 @@ describe '
# the alert box vanishes and note is still present
expect(page).to have_content 'Are you sure?'
find('.cancel').click
expect(page).to_not have_content 'Are you sure?'
expect(page).not_to have_content 'Are you sure?'
expect(page).to have_content test_note
find('.delete-note.icon-trash').click
expect(page).to have_content 'Are you sure?'
find('.confirm').click
expect(page).to_not have_content test_note
expect(page).not_to have_content test_note
end
it "viewing shipping fees" do
@@ -949,7 +949,7 @@ describe '
uncheck 'Send a shipment/pick up notification email to the customer.'
expect {
find_button("Confirm").click
}.to_not enqueue_job(ActionMailer::MailDeliveryJob)
}.not_to enqueue_job(ActionMailer::MailDeliveryJob)
end
save_screenshot('~/hello.png')
@@ -986,7 +986,7 @@ describe '
uncheck 'Send a shipment/pick up notification email to the customer.'
expect {
find_button("Confirm").click
}.to_not enqueue_job(ActionMailer::MailDeliveryJob)
}.not_to enqueue_job(ActionMailer::MailDeliveryJob)
end
expect(order.reload.shipped?).to be true
@@ -1012,7 +1012,7 @@ describe '
order.cancel!
visit spree.edit_admin_order_path(order)
within("tr.stock-item", text: order.products.first.name) do
expect(page).to_not have_selector("a.edit-item")
expect(page).not_to have_selector("a.edit-item")
end
end
end
@@ -1035,12 +1035,12 @@ describe '
accept_alert 'Are you sure?' do
find("a.delete-resource").click
end
expect(page).to_not have_content incomplete_order.products.first.name
expect(page).not_to have_content incomplete_order.products.first.name
end
# updates the order and verifies the warning disappears
click_button 'Update And Recalculate Fees'
expect(page).to_not have_content "Out of Stock".upcase
expect(page).not_to have_content "Out of Stock".upcase
end
end
end
@@ -1058,11 +1058,11 @@ describe '
expect(page).to have_selector 'td', text: product.name
expect(page).to have_select2 'order_distributor_id', with_options: [distributor1.name]
expect(page).to_not have_select2 'order_distributor_id', with_options: [distributor2.name]
expect(page).not_to have_select2 'order_distributor_id', with_options: [distributor2.name]
expect(page).to have_select2 'order_order_cycle_id',
with_options: ["#{order_cycle1.name} (open)"]
expect(page).to_not have_select2 'order_order_cycle_id',
expect(page).not_to have_select2 'order_order_cycle_id',
with_options: ["#{order_cycle2.name} (open)"]
click_button 'Update'
@@ -1189,7 +1189,7 @@ describe '
# and disappear after clicking
expect(page).not_to have_link "Create or Update Invoice"
expect(page).to_not have_content "The order has changed since the last invoice update."
expect(page).not_to have_content "The order has changed since the last invoice update."
# creating an invoice, displays a second row
expect(page.find("table").text).to have_content(table_contents)

View File

@@ -55,7 +55,7 @@ describe '
context 'order not updated since latest invoice' do
it 'should not render new invoice button' do
click_link 'Invoices'
expect(page).to_not have_link "Create or Update Invoice"
expect(page).not_to have_link "Create or Update Invoice"
end
end

View File

@@ -115,7 +115,7 @@ describe '
# Order 2 and 3 should show, but not 4
expect(page).to have_content order2.number
expect(page).to have_content order3.number
expect(page).to_not have_content order4.number
expect(page).not_to have_content order4.number
end
it "filter by distributors" do
@@ -126,7 +126,7 @@ describe '
# Order 2 and 4 should show, but not 3
expect(page).to have_content order2.number
expect(page).to_not have_content order3.number
expect(page).not_to have_content order3.number
expect(page).to have_content order4.number
end
@@ -138,7 +138,7 @@ describe '
page.find('.filter-actions .button[type=submit]').click
# Order 3 and 4 should show, but not 2
expect(page).to_not have_content order2.number
expect(page).not_to have_content order2.number
expect(page).to have_content order3.number
expect(page).to have_content order4.number
end
@@ -149,9 +149,9 @@ describe '
page.find('.filter-actions .button[type=submit]').click
# Order 3 should show, but not 2 and 4
expect(page).to_not have_content order2.number
expect(page).not_to have_content order2.number
expect(page).to have_content order3.number
expect(page).to_not have_content order4.number
expect(page).not_to have_content order4.number
end
it "filter by customer first and last names" do
@@ -161,8 +161,8 @@ describe '
page.find('.filter-actions .button[type=submit]').click
# Order 2 should show, but not 3 and 4
expect(page).to have_content order2.number
expect(page).to_not have_content order3.number
expect(page).to_not have_content order4.number
expect(page).not_to have_content order3.number
expect(page).not_to have_content order4.number
find("#clear_filters_button").click
# filtering by last name
@@ -170,8 +170,8 @@ describe '
fill_in "Last name begins with", with: billing_address4.lastname
page.find('.filter-actions .button[type=submit]').click
# Order 4 should show, but not 2 and 3
expect(page).to_not have_content order2.number
expect(page).to_not have_content order3.number
expect(page).not_to have_content order2.number
expect(page).not_to have_content order3.number
expect(page).to have_content order4.number
find("#clear_filters_button").click
@@ -194,16 +194,16 @@ describe '
page.find('.filter-actions .button[type=submit]').click
# Order 2 should show, but not 3 and 5
expect(page).to have_content order2.number
expect(page).to_not have_content order3.number
expect(page).to_not have_content order4.number
expect(page).not_to have_content order3.number
expect(page).not_to have_content order4.number
find("#clear_filters_button").click
tomselect_search_and_select "Signed, sealed, delivered", from: 'shipping_method_id'
page.find('.filter-actions .button[type=submit]').click
# Order 4 should show, but not 2 and 3
expect(page).to_not have_content order2.number
expect(page).to_not have_content order3.number
expect(page).not_to have_content order2.number
expect(page).not_to have_content order3.number
expect(page).to have_content order4.number
end
@@ -214,8 +214,8 @@ describe '
# Order 2 should show, but not 3 and 4
expect(page).to have_content order2.number
expect(page).to_not have_content order3.number
expect(page).to_not have_content order4.number
expect(page).not_to have_content order3.number
expect(page).not_to have_content order4.number
end
it "filter by order state" do
@@ -236,10 +236,10 @@ describe '
# Order 2 should show, but not 3 and 4
expect(page).to have_content order.number
expect(page).to_not have_content order2.number
expect(page).to_not have_content order3.number
expect(page).to_not have_content order4.number
expect(page).to_not have_content order5.number
expect(page).not_to have_content order2.number
expect(page).not_to have_content order3.number
expect(page).not_to have_content order4.number
expect(page).not_to have_content order5.number
end
end
@@ -496,11 +496,11 @@ describe '
page.find("#listing_orders thead th:first-child input[type=checkbox]").trigger("click")
expect(page.find(
"#listing_orders tbody tr td:first-child input[type=checkbox]"
)).to_not be_checked
)).not_to be_checked
# disables print invoices button not clickable
expect { find("span.icon-reorder", text: "ACTIONS").click }
.to raise_error(Capybara::Cuprite::MouseEventFailed)
expect(page).to_not have_content "Print Invoices"
expect(page).not_to have_content "Print Invoices"
end
end
@@ -645,7 +645,7 @@ describe '
uncheck "Send a cancellation email to the customer"
expect {
find_button("Cancel").click # Cancels the cancel action
}.to_not enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)
}.not_to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)
end
page.find("span.icon-reorder", text: "ACTIONS").click
@@ -656,7 +656,7 @@ describe '
within ".reveal-modal" do
expect {
find_button("Confirm").click # Confirms the cancel action
}.to_not enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)
}.not_to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice)
end
expect(page).to have_content("CANCELLED", count: 2)
@@ -697,7 +697,7 @@ describe '
within ".reveal-modal" do
expect {
find_button("Confirm").click
}.to_not enqueue_job(ActionMailer::MailDeliveryJob)
}.not_to enqueue_job(ActionMailer::MailDeliveryJob)
end
end
end

View File

@@ -278,11 +278,11 @@ describe "Product Import" do
proceed_to_validation
expect(page).to have_selector '.item-count', text: "3"
expect(page).to_not have_selector '.invalid-count'
expect(page).not_to have_selector '.invalid-count'
expect(page).to have_selector '.create-count', text: "3"
expect(page).to_not have_selector '.update-count'
expect(page).to_not have_selector '.inv-create-count'
expect(page).to_not have_selector '.inv-update-count'
expect(page).not_to have_selector '.update-count'
expect(page).not_to have_selector '.inv-create-count'
expect(page).not_to have_selector '.inv-update-count'
save_data

View File

@@ -714,13 +714,13 @@ describe '
visit spree.admin_product_images_path(product)
expect(page).to have_selector "table.index td img"
expect(product.reload.image).to_not be_nil
expect(product.reload.image).not_to be_nil
accept_alert do
page.find('a.delete-resource').click
end
expect(page).to_not have_selector "table.index td img"
expect(page).not_to have_selector "table.index td img"
expect(product.reload.image).to be_nil
end

View File

@@ -258,7 +258,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
expect {
click_button "Discard changes"
product_a.reload
}.to_not change { product_a.name }
}.not_to change { product_a.name }
within row_containing_name("Apples") do
expect(page).to have_field "Name", with: "Apples" # Changed value wasn't saved
@@ -295,7 +295,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
expect(page).to have_content "1 product could not be saved"
expect(page).to have_content "Please review the errors and try again"
product_a.reload
}.to_not change { product_a.name }
}.not_to change { product_a.name }
# (there's no identifier displayed, so the user must remember which product it is..)
within row_containing_name("") do
@@ -320,7 +320,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
expect(page).to have_content("1 product could not be saved")
product_a.reload
}.to_not change { product_a.name }
}.not_to change { product_a.name }
within row_containing_name("") do
fill_in "Name", with: "Pommes"
@@ -408,7 +408,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
expect(page).to have_content "1 product could not be saved"
expect(page).to have_content "Please review the errors and try again"
variant_a1.reload
}.to_not change { variant_a1.display_name }
}.not_to change { variant_a1.display_name }
# New variant
within row_containing_name("N" * 256) do
@@ -433,7 +433,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
click_button "Save changes"
variant_a1.reload
}.to_not change { variant_a1.display_name }
}.not_to change { variant_a1.display_name }
within row_containing_name("N" * 256) do
fill_in "Name", with: "Nice box"
@@ -527,7 +527,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
expect(page).to have_content "1 product could not be saved"
expect(page).to have_content "Please review the errors and try again"
variant_a1.reload
}.to_not change { variant_a1.display_name }
}.not_to change { variant_a1.display_name }
# New variant
within row_containing_name("N" * 256) do
@@ -552,7 +552,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
click_button "Save changes"
variant_a1.reload
}.to_not change { variant_a1.display_name }
}.not_to change { variant_a1.display_name }
within row_containing_name("N" * 256) do
fill_in "Name", with: "Nice box"
@@ -595,7 +595,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
expect {
click_button "Save changes"
product_a.reload
}.to_not change { product_a.name }
}.not_to change { product_a.name }
expect(page).not_to have_content("0 product was saved correctly, but")
expect(page).to have_content("1 product could not be saved")
@@ -699,7 +699,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
within row_containing_name("Medium box") do
page.find(".vertical-ellipsis-menu").click
expect(page).to_not have_link "Clone", href: spree.clone_admin_product_path(product_a)
expect(page).not_to have_link "Clone", href: spree.clone_admin_product_path(product_a)
end
end
end
@@ -711,7 +711,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
input_content = page.find_all('input[type=text]').map(&:value).join
# Products does not include the cloned product.
expect(input_content).to_not match /COPY OF Apples/
expect(input_content).not_to match /COPY OF Apples/
end
within row_containing_name("Apples") do
@@ -757,7 +757,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
# to select the default variant
within default_variant_selector do
page.find(".vertical-ellipsis-menu").click
expect(page).to_not have_css(delete_option_selector)
expect(page).not_to have_css(delete_option_selector)
end
end
@@ -806,7 +806,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
page.find(keep_button_selector).click
end
expect(page).to_not have_selector(modal_selector)
expect(page).not_to have_selector(modal_selector)
expect(page).to have_selector(product_selector)
# Keep Variant
@@ -819,7 +819,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
page.find(keep_button_selector).click
end
expect(page).to_not have_selector(modal_selector)
expect(page).not_to have_selector(modal_selector)
expect(page).to have_selector(variant_selector)
end
end
@@ -839,10 +839,10 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
page.find(delete_button_selector).click
end
expect(page).to_not have_selector(modal_selector)
expect(page).not_to have_selector(modal_selector)
# Make sure the products loading spinner is hidden
wait_for_class('.spinner-overlay', 'hidden')
expect(page).to_not have_selector(variant_selector)
expect(page).not_to have_selector(variant_selector)
within success_flash_message_selector do
expect(page).to have_content("Successfully deleted the variant")
page.find(dismiss_button_selector).click
@@ -857,10 +857,10 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
within modal_selector do
page.find(delete_button_selector).click
end
expect(page).to_not have_selector(modal_selector)
expect(page).not_to have_selector(modal_selector)
# Make sure the products loading spinner is hidden
wait_for_class('.spinner-overlay', 'hidden')
expect(page).to_not have_selector(product_selector)
expect(page).not_to have_selector(product_selector)
within success_flash_message_selector do
expect(page).to have_content("Successfully deleted the product")
end
@@ -881,7 +881,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
page.find(delete_button_selector).click
end
expect(page).to_not have_selector(modal_selector)
expect(page).not_to have_selector(modal_selector)
sleep(0.5) # delay for loading spinner to complete
expect(page).to have_selector(variant_selector)
within error_flash_message_selector do
@@ -898,7 +898,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
within modal_selector do
page.find(delete_button_selector).click
end
expect(page).to_not have_selector(modal_selector)
expect(page).not_to have_selector(modal_selector)
sleep(0.5) # delay for loading spinner to complete
expect(page).to have_selector(product_selector)
within error_flash_message_selector do

View File

@@ -532,10 +532,10 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do
expect(table).to have_content(cost_of_produce2)
expect(table).to have_content(summary_row2)
expect(table).to_not have_content(supplier_state_tax1)
expect(table).to_not have_content(supplier_country_tax1)
expect(table).to_not have_content(cost_of_produce1)
expect(table).to_not have_content(summary_row1)
expect(table).not_to have_content(supplier_state_tax1)
expect(table).not_to have_content(supplier_country_tax1)
expect(table).not_to have_content(cost_of_produce1)
expect(table).not_to have_content(summary_row1)
end
it "should filter by fee name" do
@@ -550,19 +550,19 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do
expect(table).to have_content(supplier_state_tax1)
expect(table).to have_content(supplier_country_tax1)
expect(table).to_not have_content(distributor_state_tax1)
expect(table).to_not have_content(distributor_country_tax1)
expect(table).to_not have_content(coordinator_state_tax1)
expect(table).to_not have_content(coordinator_country_tax1)
expect(table).not_to have_content(distributor_state_tax1)
expect(table).not_to have_content(distributor_country_tax1)
expect(table).not_to have_content(coordinator_state_tax1)
expect(table).not_to have_content(coordinator_country_tax1)
expect(table).to have_content(cost_of_produce1)
expect(table).to have_content(summary_row1)
expect(table).to have_content(supplier_state_tax3)
expect(table).to have_content(supplier_country_tax3)
expect(table).to_not have_content(distributor_state_tax3)
expect(table).to_not have_content(distributor_country_tax3)
expect(table).to_not have_content(coordinator_state_tax3)
expect(table).to_not have_content(coordinator_country_tax3)
expect(table).not_to have_content(distributor_state_tax3)
expect(table).not_to have_content(distributor_country_tax3)
expect(table).not_to have_content(coordinator_state_tax3)
expect(table).not_to have_content(coordinator_country_tax3)
expect(table).to have_content(cost_of_produce3)
expect(table).to have_content(summary_row3)
end
@@ -577,10 +577,10 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do
table = page.find("table.report__table tbody")
expect(table).to have_content(supplier_state_tax1)
expect(table).to have_content(supplier_country_tax1)
expect(table).to_not have_content(distributor_state_tax1)
expect(table).to_not have_content(distributor_country_tax1)
expect(table).to_not have_content(coordinator_state_tax1)
expect(table).to_not have_content(coordinator_country_tax1)
expect(table).not_to have_content(distributor_state_tax1)
expect(table).not_to have_content(distributor_country_tax1)
expect(table).not_to have_content(coordinator_state_tax1)
expect(table).not_to have_content(coordinator_country_tax1)
expect(table).to have_content(cost_of_produce1)
expect(table).to have_content(summary_row_after_filtering_by_fee_owner)
end

View File

@@ -371,7 +371,7 @@ describe 'Subscriptions' do
expect{
click_button('Create Subscription')
expect(page).to have_content 'Please add at least one product'
}.to_not change { Subscription.count }
}.not_to change { Subscription.count }
end
context 'and adding a new product' do

View File

@@ -33,7 +33,7 @@ describe 'Subscriptions' do
expect(page).to have_content "Just a few more steps before you can begin"
# subscriptions are enabled, instructions are not displayed
expect(page).to_not have_content 'Under "Shop Preferences", /
expect(page).not_to have_content 'Under "Shop Preferences", /
enable the Subscriptions option'
# other relevant instructions are displayed
@@ -54,7 +54,7 @@ describe 'Subscriptions' do
end
it "the subscriptions tab is not visible" do
expect(page).to have_current_path "/admin/orders"
expect(page).to_not have_link "Subscriptions", href: "/admin/subscriptions"
expect(page).not_to have_link "Subscriptions", href: "/admin/subscriptions"
end
end
end

View File

@@ -26,11 +26,11 @@ describe 'Terms of Service banner' do
click_button "Accept Terms of Service"
admin_user.reload
end.to change { admin_user.terms_of_service_accepted_at }
expect(page).to_not have_content("Terms of Service have been updated")
expect(page).not_to have_content("Terms of Service have been updated")
# Check the banner doesn't show again once ToS has been accepted
page.refresh
expect(page).to_not have_content("Terms of Service have been updated")
expect(page).not_to have_content("Terms of Service have been updated")
end
end

View File

@@ -167,7 +167,7 @@ describe '
login_as_admin
visit spree.edit_admin_product_variant_path(product, variant)
expect(page).to_not have_field "unit_value_human"
expect(page).not_to have_field "unit_value_human"
expect(page).to have_field "variant_weight"
expect(page).to have_field "variant_unit_description", with: "foo"