Skip to content

Fix circular reference in factory#3959

Merged
kennyadsl merged 1 commit intosolidusio:masterfrom
nebulab:fix_order_totals_factory
Feb 26, 2021
Merged

Fix circular reference in factory#3959
kennyadsl merged 1 commit intosolidusio:masterfrom
nebulab:fix_order_totals_factory

Conversation

@waiting-for-dev
Copy link
Copy Markdown
Contributor

@waiting-for-dev waiting-for-dev commented Feb 25, 2021

This was causing a double in-memory addition of the same line item to an
order.

From the repository root:

gem which factory_bot
bin/rails console

And then, from the console:

$LOAD_PATH << '/lib/directory/for/factory/bot/from/above/'
require_relative '../core/lib/spree/testing_support/factories/order_factory'
order = FactoryBot.create(:order_with_totals)
order.line_items.count # 1
order.line_items.size # 2, before this commit
order.line_items.size # 1, after this commit

Description

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

cc @kennyadsl

This was causing a double in-memory addition of the same line item to an
order.

From the repository root:

```bash
gem which factory_bot
bin/rails console
```

And then, from the console:

```ruby
$LOAD_PATH << '/lib/directory/for/factory/bot/from/above/'
require_relative '../core/lib/spree/testing_support/factories/order_factory'
order = FactoryBot.create(:order_with_totals)
order.line_items.count # 1
order.line_items.size # 2, before this commit
order.line_items.size # 1, after this commit
```
waiting-for-dev added a commit to solidusio/solidus_starter_frontend that referenced this pull request Feb 25, 2021
We were adding another line to match buggy behavior caused by the
circular reference fixed in solidusio/solidus#3959.

Tests will be green once both changes are integrated.
Copy link
Copy Markdown
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kennyadsl kennyadsl added changelog:solidus_core Changes to the solidus_core gem Needs Backport labels Feb 25, 2021
Copy link
Copy Markdown
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kennyadsl kennyadsl merged commit cff5fc0 into solidusio:master Feb 26, 2021
@kennyadsl kennyadsl deleted the fix_order_totals_factory branch February 26, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants