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

Add factories for the Switch and HostSwitch models #17416

Merged
merged 1 commit into from
May 14, 2018

Conversation

skateman
Copy link
Member

I am writing some tests for infrastructure networking and these factories are required.

@miq-bot add_label test
@miq-bot assign @martinpovolny

@@ -0,0 +1,3 @@
FactoryGirl.define do
factory :host_switch
Copy link
Member

Choose a reason for hiding this comment

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

Why is this required?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I added a hack so that we don't need to define all of these empty factories.

https://github.com/ManageIQ/manageiq/blob/master/spec/support/missing_factory_helper.rb#L1

@@ -0,0 +1,4 @@
FactoryGirl.define do
factory :switch
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I thought we need a parent factory if I'm creating a specific one...

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so since it's not inheriting anything. The factory being created is just for the convenience of not needing to type out the class name.

@skateman skateman force-pushed the switch-factories branch from 42b3583 to ca71a90 Compare May 14, 2018 14:37
@miq-bot
Copy link
Member

miq-bot commented May 14, 2018

Checked commit skateman@ca71a90 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

@bdunne bdunne merged commit 271a0f0 into ManageIQ:master May 14, 2018
@bdunne bdunne assigned bdunne and unassigned martinpovolny May 14, 2018
@bdunne bdunne added this to the Sprint 86 Ending May 21, 2018 milestone May 14, 2018
@skateman skateman deleted the switch-factories branch May 14, 2018 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants