Project

General

Profile

« Previous | Next » 

Revision 9caab04b

Added by Timo Goebel over 7 years ago

fixes #13618 - cache expensive vmware api calls

View differences:

test/controllers/compute_resources_controller_test.rb
end
end
context 'compute resource cache' do
test 'should refresh the cache' do
@compute_resource = compute_resources(:vmware)
put :refresh_cache, {:id => @compute_resource.to_param}, set_session_user
assert_redirected_to compute_resource_url(@compute_resource)
assert_match /Successfully refreshed the cache/, flash[:notice]
end
test 'should not refresh the cache if unsupported' do
put :refresh_cache, {:id => @compute_resource.to_param}, set_session_user
assert_redirected_to compute_resource_url(@compute_resource)
assert_match /Failed to refresh the cache/, flash[:error]
end
end
def set_session_user
User.current = users(:admin) unless User.current
SETTINGS[:login] ? {:user => User.current.id, :expires_at => 5.minutes.from_now} : {}

Also available in: Unified diff