Skip to content

refactoring methods in catalog_controller_spec.rb #3885

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

Merged
merged 1 commit into from
May 17, 2018

Conversation

VratislavHais
Copy link
Contributor

Parent issue: #1134

@VratislavHais
Copy link
Contributor Author

@miq_bot add_label rbac
@miq_bot add_label refactoring

@romanblanco @lpichler

@romanblanco
Copy link
Member

@miq-bot add_label wip

@miq-bot miq-bot changed the title Xhais [WIP] Xhais May 3, 2018
@miq-bot miq-bot added the wip label May 3, 2018
@VratislavHais VratislavHais changed the title [WIP] Xhais Xhais May 4, 2018
@miq-bot miq-bot removed the wip label May 4, 2018
@romanblanco
Copy link
Member

@VratislavHais please, change the title, so it describes the change you are doing in the PR

@VratislavHais VratislavHais changed the title Xhais refactoring methods in catalog_controller_spec.rb May 4, 2018
@VratislavHais
Copy link
Contributor Author

code review: @oslegl

allow(controller).to receive(:find_checked_items).and_return(ServiceTemplate.all.ids)
allow(controller).to receive(:tag_edit_build_entries_pulldown).and_return(nil)
allow(controller).to receive(:replace_right_cell).with(:action => nil)
controller.send(:x_edit_tags_reset, "ServiceTemplate")
Copy link
Member

Choose a reason for hiding this comment

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

@VratislavHais expected behaviour is missing here

@VratislavHais
Copy link
Contributor Author

travis failed on a different file. Can you please restart it?

@lpichler
Copy link
Contributor

close/open PR to restart it.

controller.instance_variable_set(:@_params, {}) # affects params in controller
controller.instance_variable_set(:@sb, :action => nil)
allow(controller).to receive(:checked_or_params).and_return(ServiceTemplate.all.ids)
allow(controller).to receive(:find_checked_items).and_return(ServiceTemplate.all.ids)
Copy link
Member

@romanblanco romanblanco May 10, 2018

Choose a reason for hiding this comment

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

this line shouldn't be necessary, as you're already mocking checked_or_params.

(same as https://github.com/ManageIQ/manageiq-ui-classic/pull/3891/files#r187269347)

@miq-bot
Copy link
Member

miq-bot commented May 10, 2018

Checked commit VratislavHais@294a8ea with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

Copy link
Member

@romanblanco romanblanco left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@martinpovolny martinpovolny added this to the Sprint 86 Ending May 21, 2018 milestone May 17, 2018
@martinpovolny martinpovolny merged commit 1df2669 into ManageIQ:master May 17, 2018
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.

6 participants