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

@@ -21,7 +21,7 @@ describe Api::Admin::EnterpriseSerializer do
it "includes URLs of image versions" do
serializer = Api::Admin::EnterpriseSerializer.new(enterprise)
expect(serializer.as_json[:logo]).to_not be_blank
expect(serializer.as_json[:logo]).not_to be_blank
expect(serializer.as_json[:logo][:medium]).to match(/logo-black.png/)
end
end
@@ -46,7 +46,7 @@ describe Api::Admin::EnterpriseSerializer do
it "includes URLs of image versions" do
serializer = Api::Admin::EnterpriseSerializer.new(enterprise)
expect(serializer.as_json[:promo_image]).to_not be_blank
expect(serializer.as_json[:promo_image]).not_to be_blank
expect(serializer.as_json[:promo_image][:medium]).to match(/logo-black\.png$/)
end
end

View File

@@ -40,7 +40,7 @@ describe Api::Admin::ExchangeSerializer do
.with(exchange.order_cycle.coordinator)
expect(exchange.variants).to include v1, v2, v3
expect(visible_variants.keys).to include v1.id
expect(visible_variants.keys).to_not include v2.id, v3.id
expect(visible_variants.keys).not_to include v2.id, v3.id
end
end
@@ -54,10 +54,10 @@ describe Api::Admin::ExchangeSerializer do
visible_variants = serializer.variants
expect(permissions_mock).to have_received(:visible_variants_for_incoming_exchanges_from)
.with(exchange.sender)
expect(permitted_variants).to_not have_received(:visible_for)
expect(permitted_variants).not_to have_received(:visible_for)
expect(exchange.variants).to include v1, v2, v3
expect(visible_variants.keys).to include v1.id, v2.id
expect(visible_variants.keys).to_not include v3.id
expect(visible_variants.keys).not_to include v3.id
end
end
end
@@ -88,10 +88,10 @@ describe Api::Admin::ExchangeSerializer do
expect(permissions_mock).to have_received(:visible_variants_for_outgoing_exchanges_to)
.with(exchange.receiver)
expect(permitted_variants).to have_received(:not_hidden_for).with(exchange.receiver)
expect(permitted_variants).to_not have_received(:visible_for)
expect(permitted_variants).not_to have_received(:visible_for)
expect(exchange.variants).to include v1, v2, v3
expect(visible_variants.keys).to include v1.id, v2.id
expect(visible_variants.keys).to_not include v3.id
expect(visible_variants.keys).not_to include v3.id
end
end
@@ -107,10 +107,10 @@ describe Api::Admin::ExchangeSerializer do
expect(permissions_mock).to have_received(:visible_variants_for_outgoing_exchanges_to)
.with(exchange.receiver)
expect(permitted_variants).to have_received(:visible_for).with(exchange.receiver)
expect(permitted_variants).to_not have_received(:not_hidden_for)
expect(permitted_variants).not_to have_received(:not_hidden_for)
expect(exchange.variants).to include v1, v2, v3
expect(visible_variants.keys).to include v1.id
expect(visible_variants.keys).to_not include v2.id, v3.id
expect(visible_variants.keys).not_to include v2.id, v3.id
end
end
end

View File

@@ -22,7 +22,7 @@ describe Api::Admin::OrderCycleSerializer do
variant_ids = from_json(serializer.editable_variants_for_incoming_exchanges).values.flatten
expect(variant_ids).to include order_cycle.variants.first.id
expect(distributor_ids).to_not include order_cycle.distributors.first.id.to_s
expect(distributor_ids).not_to include order_cycle.distributors.first.id.to_s
end
it "serializes the order cycle with editable_variants_for_outgoing_exchanges" do