mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Enforce RSpec expect(..).not_to over to_not
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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']"
|
||||
|
||||
@@ -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|
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ describe "Credit Cards" do
|
||||
within(".card#card#{non_default_card.id}") do
|
||||
expect(page).to have_content non_default_card.cc_type.capitalize
|
||||
expect(page).to have_content non_default_card.last_digits
|
||||
expect(find_field('default_card')).to_not be_checked
|
||||
expect(find_field('default_card')).not_to be_checked
|
||||
end
|
||||
|
||||
# Allows switching of default card
|
||||
@@ -73,7 +73,7 @@ describe "Credit Cards" do
|
||||
|
||||
expect(default_card.reload.is_default).to be false
|
||||
within(".card#card#{default_card.id}") do
|
||||
expect(find_field('default_card')).to_not be_checked
|
||||
expect(find_field('default_card')).not_to be_checked
|
||||
end
|
||||
expect(non_default_card.reload.is_default).to be true
|
||||
|
||||
@@ -94,7 +94,7 @@ describe "Credit Cards" do
|
||||
|
||||
# Allows authorisation of card use by shops
|
||||
within "tr#customer#{customer.id}" do
|
||||
expect(find_field('allow_charges')).to_not be_checked
|
||||
expect(find_field('allow_charges')).not_to be_checked
|
||||
find_field('allow_charges').click
|
||||
end
|
||||
expect(page).to have_content 'Changes saved.'
|
||||
|
||||
@@ -47,7 +47,7 @@ describe "Developer Settings" do
|
||||
|
||||
click_button I18n.t(:delete)
|
||||
expect(page.document).to have_content I18n.t('webhook_endpoints.destroy.success')
|
||||
expect(page).to_not have_content "https://url"
|
||||
expect(page).not_to have_content "https://url"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -59,7 +59,7 @@ describe "Developer Settings" do
|
||||
|
||||
it "does not show the developer settings tab" do
|
||||
within("#account-tabs") do
|
||||
expect(page).to_not have_selector("a", text: "DEVELOPER SETTINGS")
|
||||
expect(page).not_to have_selector("a", text: "DEVELOPER SETTINGS")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,7 +38,7 @@ describe "Payments requiring action" do
|
||||
visit "/account"
|
||||
|
||||
find("a", text: /Transactions/i).click
|
||||
expect(page).to_not have_content 'Authorisation Required'
|
||||
expect(page).not_to have_content 'Authorisation Required'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,7 +47,7 @@ Your email address will be updated once the new email is confirmed." % 'new@emai
|
||||
click_button 'Update'
|
||||
expect(find(".alert-box.success").text.strip).to eq "Account updated!\n×"
|
||||
|
||||
expect(user.reload.encrypted_password).to_not eq initial_password
|
||||
expect(user.reload.encrypted_password).not_to eq initial_password
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,8 +35,8 @@ describe "Darkswarm data caching", caching: true do
|
||||
|
||||
visit shops_path
|
||||
|
||||
expect(Spree::Taxon).to_not receive(:all)
|
||||
expect(Spree::Property).to_not receive(:all)
|
||||
expect(Spree::Taxon).not_to receive(:all)
|
||||
expect(Spree::Property).not_to receive(:all)
|
||||
|
||||
visit shops_path
|
||||
end
|
||||
@@ -66,7 +66,7 @@ describe "Darkswarm data caching", caching: true do
|
||||
visit shops_path
|
||||
|
||||
# Wait for /shops page to load properly before checking for new timestamps
|
||||
expect(page).to_not have_selector ".row.filter-box"
|
||||
expect(page).not_to have_selector ".row.filter-box"
|
||||
|
||||
taxon_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Taxon)
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_taxons[0]}"
|
||||
@@ -74,8 +74,8 @@ describe "Darkswarm data caching", caching: true do
|
||||
property_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Property)
|
||||
expect_cached "views/#{CacheService::FragmentCaching.ams_all_properties[0]}"
|
||||
|
||||
expect(taxon_timestamp1).to_not eq taxon_timestamp2
|
||||
expect(property_timestamp1).to_not eq property_timestamp2
|
||||
expect(taxon_timestamp1).not_to eq taxon_timestamp2
|
||||
expect(property_timestamp1).not_to eq property_timestamp2
|
||||
|
||||
toggle_filters
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ describe "Shops caching", caching: true do
|
||||
|
||||
visit shops_path
|
||||
|
||||
expect(page).to_not have_content "New Name" # Displayed name is unchanged
|
||||
expect(page).not_to have_content "New Name" # Displayed name is unchanged
|
||||
end
|
||||
|
||||
# A while later...
|
||||
|
||||
@@ -152,7 +152,7 @@ describe "As a consumer, I want to checkout my order" do
|
||||
before do
|
||||
expect {
|
||||
proceed_to_payment
|
||||
}.to_not change {
|
||||
}.not_to change {
|
||||
user.reload.bill_address
|
||||
}
|
||||
end
|
||||
@@ -206,7 +206,7 @@ describe "As a consumer, I want to checkout my order" do
|
||||
before do
|
||||
expect {
|
||||
proceed_to_payment
|
||||
}.to_not change {
|
||||
}.not_to change {
|
||||
user.reload.ship_address
|
||||
}
|
||||
end
|
||||
|
||||
@@ -131,9 +131,9 @@ describe "As a consumer, I want to checkout my order" do
|
||||
visit checkout_step_path(:summary)
|
||||
|
||||
within "#checkout" do
|
||||
expect(page).to_not have_field "order_accept_terms"
|
||||
expect(page).to_not have_link "Terms and Conditions"
|
||||
expect(page).to_not have_link "Terms of service"
|
||||
expect(page).not_to have_field "order_accept_terms"
|
||||
expect(page).not_to have_link "Terms and Conditions"
|
||||
expect(page).not_to have_link "Terms of service"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -347,7 +347,7 @@ describe "As a consumer, I want to checkout my order" do
|
||||
order.distributor.save
|
||||
visit checkout_step_path(:summary)
|
||||
|
||||
expect(page).to_not have_content("You have an order for this order cycle already.")
|
||||
expect(page).not_to have_content("You have an order for this order cycle already.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -393,8 +393,8 @@ describe "As a consumer, I want to checkout my order" do
|
||||
|
||||
it_behaves_like "order confirmation page", "PAID", "50" do
|
||||
before do
|
||||
expect(page).to_not have_selector('h5', text: "Credit Owed")
|
||||
expect(page).to_not have_selector('h5', text: "Balance Due")
|
||||
expect(page).not_to have_selector('h5', text: "Credit Owed")
|
||||
expect(page).not_to have_selector('h5', text: "Balance Due")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -110,10 +110,10 @@ describe 'Groups' do
|
||||
|
||||
it "adjusts visibilities of enterprises depending on their status" do
|
||||
expect(page).to have_css('hub', text: d1.name)
|
||||
expect(page).to_not have_css('hub.inactive', text: d1.name)
|
||||
expect(page).not_to have_css('hub.inactive', text: d1.name)
|
||||
expect(page).to have_css('hub', text: d2.name)
|
||||
expect(page).to_not have_css('hub.inactive', text: d2.name)
|
||||
expect(page).to_not have_text d3.name
|
||||
expect(page).not_to have_css('hub.inactive', text: d2.name)
|
||||
expect(page).not_to have_text d3.name
|
||||
expect(page).to have_css('hub.inactive', text: d4.name)
|
||||
end
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ describe "Registration" do
|
||||
# Upload logo image
|
||||
attach_file "image-select", Rails.root.join("spec/fixtures/files/logo.png"), visible: false
|
||||
expect(page).not_to have_css('#image-placeholder .loading')
|
||||
expect(page.find('#image-placeholder img')['src']).to_not be_empty
|
||||
expect(page.find('#image-placeholder img')['src']).not_to be_empty
|
||||
|
||||
# Move from logo page
|
||||
click_button "Continue"
|
||||
@@ -111,7 +111,7 @@ describe "Registration" do
|
||||
# Upload promo image
|
||||
attach_file "image-select", Rails.root.join("spec/fixtures/files/promo.png"), visible: false
|
||||
expect(page).not_to have_css('#image-placeholder .loading')
|
||||
expect(page.find('#image-placeholder img')['src']).to_not be_empty
|
||||
expect(page.find('#image-placeholder img')['src']).not_to be_empty
|
||||
|
||||
# Move from promo page
|
||||
click_button "Continue"
|
||||
|
||||
@@ -246,13 +246,13 @@ describe "full-page cart" do
|
||||
|
||||
# Quantity field clearly marked as invalid and "Update" button is not highlighted
|
||||
expect(page).to have_selector "#order_line_items_attributes_0_quantity.ng-invalid-stock"
|
||||
expect(page).to_not have_selector "#update-button.alert"
|
||||
expect(page).not_to have_selector "#update-button.alert"
|
||||
|
||||
fill_in "order_line_items_attributes_0_quantity", with: 4
|
||||
|
||||
# Quantity field not marked as invalid and "Update" button is
|
||||
# highlighted after correction
|
||||
expect(page).to_not have_selector(
|
||||
expect(page).not_to have_selector(
|
||||
"#order_line_items_attributes_0_quantity.ng-invalid-stock"
|
||||
)
|
||||
expect(page).to have_selector "#update-button.alert"
|
||||
@@ -260,8 +260,8 @@ describe "full-page cart" do
|
||||
click_button 'Update'
|
||||
|
||||
# "Continue Shopping" and "Checkout" buttons are not disabled after cart is updated
|
||||
expect(page).to_not have_selector "a.continue-shopping[disabled=disabled]"
|
||||
expect(page).to_not have_selector "a#checkout-link[disabled=disabled]"
|
||||
expect(page).not_to have_selector "a.continue-shopping[disabled=disabled]"
|
||||
expect(page).not_to have_selector "a#checkout-link[disabled=disabled]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -318,7 +318,7 @@ describe "full-page cart" do
|
||||
end
|
||||
|
||||
it "doesn't throw an error" do
|
||||
expect{ visit main_app.cart_path }.to_not raise_error
|
||||
expect{ visit main_app.cart_path }.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ describe "Order Management" do
|
||||
it "allows the user to see the details" do
|
||||
# Cannot load the page without token
|
||||
visit order_path(order)
|
||||
expect(page).to_not be_confirmed_order_page
|
||||
expect(page).not_to be_confirmed_order_page
|
||||
|
||||
# Can load the page with token
|
||||
visit order_path(order, order_token: order.token)
|
||||
@@ -87,7 +87,7 @@ describe "Order Management" do
|
||||
it "allows the user to see order details after login" do
|
||||
# Cannot load the page without signing in
|
||||
visit order_path(order)
|
||||
expect(page).to_not be_confirmed_order_page
|
||||
expect(page).not_to be_confirmed_order_page
|
||||
|
||||
# Can load the page after signing in
|
||||
fill_in_and_submit_login_form user
|
||||
|
||||
@@ -62,7 +62,7 @@ describe "As a consumer I want to shop with a distributor" do
|
||||
(all_tabs - tabs).each do |tab|
|
||||
it "does not show the #{tab} tab" do
|
||||
within ".tab-buttons" do
|
||||
expect(page).to_not have_content tab
|
||||
expect(page).not_to have_content tab
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -132,8 +132,8 @@ describe "As a consumer I want to shop with a distributor" do
|
||||
end
|
||||
|
||||
it "does not show the producer modal" do
|
||||
expect(page).to_not have_link supplier.name
|
||||
expect(page).to_not have_selector ".reveal-modal"
|
||||
expect(page).not_to have_link supplier.name
|
||||
expect(page).not_to have_selector ".reveal-modal"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -549,7 +549,7 @@ describe "As a consumer I want to shop with a distributor" do
|
||||
|
||||
click_add_to_cart variant
|
||||
|
||||
expect(page).to_not have_selector '.out-of-stock-modal'
|
||||
expect(page).not_to have_selector '.out-of-stock-modal'
|
||||
end
|
||||
|
||||
context "group buy products" do
|
||||
|
||||
@@ -246,7 +246,7 @@ describe 'Shops' do
|
||||
|
||||
it "does not show the producer modal" do
|
||||
open_enterprise_modal producer
|
||||
expect(page).to_not have_selector(".reveal-modal")
|
||||
expect(page).not_to have_selector(".reveal-modal")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ describe "User password confirm/reset page" do
|
||||
click_button
|
||||
|
||||
expect(page).to have_text "User password cannot be blank. Please enter a password."
|
||||
expect(page).to_not be_logged_in_as user
|
||||
expect(page).not_to be_logged_in_as user
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ describe 'White label setting' do
|
||||
shared_examples "shows the right link on the logo" do
|
||||
it "shows the white label logo link" do
|
||||
within ".nav-logo .ofn-logo" do
|
||||
expect(page).to_not have_selector "a[href='/']"
|
||||
expect(page).not_to have_selector "a[href='/']"
|
||||
expect(page).to have_selector "a[href*='https://www.example.com']"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user