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

StorageScan button spec - fix spec after .ext_management_systems removal #6662

Merged
merged 2 commits into from
Feb 6, 2020
Merged

StorageScan button spec - fix spec after .ext_management_systems removal #6662

merged 2 commits into from
Feb 6, 2020

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Feb 6, 2020

.ext_management_systems was removed from Storage in ManageIQ/manageiq#19754
fixing the specs to use .ext_management_system (singular).

Cc @kbrock

Fixes red travis:

  1) ApplicationHelper::Button::StorageScan when feature is supported #calculate_properties with valid credentials for this Datastore behaves like an enabled button is expected to be truthy
     Failure/Error: expect(subject[:enabled]).to be_truthy

       expected: truthy value
            got: false
     Shared Example Group: "an enabled button" called from ./spec/helpers/application_helper/buttons/storage_scan_spec.rb:35
     # ./spec/support/examples_group/shared_examples_for_enabled_buttons.rb:4:in `block (2 levels) in <top (required)>'
  2) ApplicationHelper::Button::StorageScan when feature is supported #calculate_properties but no EMS has valid credentials for the Datastore behaves like a disabled button is expected to eq "There are no EMSs with valid credentials for this Datastore"
     Failure/Error: expect(subject[:title]).to eq(err_msg)

       expected: "There are no EMSs with valid credentials for this Datastore"
            got: "Smartstate Analysis cannot be performed on selected Datastore"

       (compared using ==)
     Shared Example Group: "a disabled button" called from ./spec/helpers/application_helper/buttons/storage_scan_spec.rb:32
     # ./spec/support/examples_group/shared_examples_for_disabled_buttons.rb:5:in `block (2 levels) in <top (required)>'

rspec ./spec/helpers/application_helper/buttons/storage_scan_spec.rb:35 # ApplicationHelper::Button::StorageScan when feature is supported #calculate_properties with valid credentials for this Datastore behaves like an enabled button is expected to be truthy
rspec ./spec/helpers/application_helper/buttons/storage_scan_spec.rb:32 # ApplicationHelper::Button::StorageScan when feature is supported #calculate_properties but no EMS has valid credentials for the Datastore behaves like a disabled button is expected to eq "There are no EMSs with valid credentials for this Datastore"

`.ext_management_systems` was removed from Storage in ManageIQ/manageiq#19754
fixing the specs to use `.ext_management_system` (singular).

before { allow(record).to receive(:ext_management_systems).and_return(emss) }
before { allow(record).to receive(:ext_management_systems_with_authentication_status_ok).and_return(emss_with_valid_auth) }
before { allow(record).to receive(:ext_management_system).and_return(ems) }
Copy link
Member

Choose a reason for hiding this comment

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

@himdel could you create the storage record in this context with the ems instead of stubbing the call? Now that it is a simple belongs to that is a lot easier to do where before you'd have to link it up to hosts and host storages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, updated :)

@miq-bot
Copy link
Member

miq-bot commented Feb 6, 2020

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/0675c7dd8cc76ee78c5fe8795f0093fb0a60d2aa~...aeebaf1003bb6c85107a63e5e4830f202a0516d6 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

Thanks. Looking good

@mzazrivec mzazrivec self-assigned this Feb 6, 2020
@mzazrivec mzazrivec added this to the Sprint 130 Ending Feb 17, 2020 milestone Feb 6, 2020
@mzazrivec mzazrivec merged commit 6916b23 into ManageIQ:master Feb 6, 2020
@himdel himdel deleted the storage-spec branch February 6, 2020 14:48
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.

5 participants