Skip to content

Commit

Permalink
Merge pull request #3407 from hstastna/Refresh_UI_Tags_Datastore_vCen…
Browse files Browse the repository at this point in the history
…ter_VMware

Fix displaying correct tags of Datastore of a provider
(cherry picked from commit aaac0a4)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1594326
  • Loading branch information
martinpovolny authored and simaishi committed Jun 22, 2018
1 parent 902a819 commit 91f9ba5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/storage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def explorer
end

build_accordions_and_trees
get_tagdata(@record) if @record
@lastaction = "explorer" # restore the explorer layout, which was changed by process_show_list() to "show_list"

render :layout => "application"
Expand Down
18 changes: 17 additions & 1 deletion spec/controllers/storage_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
context 'render_views' do
render_views

context '#explorer' do
describe '#explorer' do
before do
session[:settings] = {:views => {}, :perpage => {:list => 5}}
EvmSpecHelper.create_guid_miq_server_zone
Expand Down Expand Up @@ -217,6 +217,22 @@
expect(response.body).to_not be_empty
expect(response).to render_template('shared/summary/_textual')
end

context 'getting the right tags of a datastore' do
let(:datastore) { FactoryGirl.create(:storage, :name => 'storage_name') }

before do
allow(controller).to receive(:render).and_return(true)

controller.instance_variable_set(:@record, datastore)
controller.instance_variable_set(:@sb, :active_tree => :storage_tree)
end

it 'calls get_tagdata to update tags of a datastore' do
expect(controller).to receive(:get_tagdata).with(datastore)
controller.send(:explorer)
end
end
end

context "#tree_select" do
Expand Down

0 comments on commit 91f9ba5

Please sign in to comment.