Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uninitialized constant error when running model specs #6035

Merged
merged 1 commit into from
Sep 16, 2020
Merged

Fix uninitialized constant error when running model specs #6035

merged 1 commit into from
Sep 16, 2020

Conversation

arku
Copy link
Contributor

@arku arku commented Sep 16, 2020

What? Why?

When running the model specs with bundle exec rspec spec/models, the following error occurs:

An error occurred while loading ./spec/models/adjustment_metadata_spec.rb.
Failure/Error:
  describe AdjustmentMetadata do
    it "is valid when build from factory" do
      adjustment = create(:adjustment)
      expect(adjustment).to be_valid
    end
  end
NameError:
  uninitialized constant AdjustmentMetadata
# ./spec/models/adjustment_metadata_spec.rb:1:in `<top (required)>'

The PR fixes the issue by requiring spec_helper in the AdjustmentMetadata model spec.

What should we test?

Run bundle exec rspec spec and make sure the tests pass.

Release notes

Changelog Category: Fixed

Discourse thread

Dependencies

Documentation updates

Copy link
Contributor

@luisramos0 luisramos0 left a comment

Choose a reason for hiding this comment

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

Thank you!

@luisramos0 luisramos0 merged commit 8d5ed63 into openfoodfoundation:master Sep 16, 2020
@arku arku deleted the fix/adjustment-metadata-spec branch September 16, 2020 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants