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 copying tag as optional choice #19206

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

astrozzc
Copy link
Contributor

@astrozzc astrozzc commented Aug 26, 2019

When service template is copied, tags might also need to be copied as well. This change adds an optional filed to allow tags to be copied as well.

https://bugzilla.redhat.com/show_bug.cgi?id=1740399

@astrozzc
Copy link
Contributor Author

@miq-bot assign @tinaafitz

@astrozzc
Copy link
Contributor Author

@miq-bot add_label enhancement, ivanchuk/yes, services, changelog/yes


new_template = service_template.template_copy

expect(new_template.tags.count).to eq(0)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of eq(0) use be_zero

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know that!


new_template = service_template.template_copy(:copy_tags => true)

expect(new_template.tags.count).to eq(2)
Copy link
Member

Choose a reason for hiding this comment

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

We should be checking that the tags on the new_template match the original template, not just the count.

You can do that with expect(new_template.tags).to match_array(service_template.tags)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this!

When service template is copied, tags might also need
to be copied as requested. This change adds an optional filed
to allow tags to be copied as well.
@miq-bot
Copy link
Member

miq-bot commented Aug 29, 2019

Checked commit astrozzc@09159b3 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

Copy link
Member

@gmcculloug gmcculloug left a comment

Choose a reason for hiding this comment

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

@tinaafitz Please review

Copy link
Member

@tinaafitz tinaafitz left a comment

Choose a reason for hiding this comment

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

@astrozzc Looks good. :-)

@gmcculloug gmcculloug merged commit 129973b into ManageIQ:master Sep 3, 2019
@gmcculloug gmcculloug added this to the Sprint 120 Ending Sep 16, 2019 milestone Sep 3, 2019
@gmcculloug
Copy link
Member

🎉 Thanks for the PR @astrozzc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants