1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/requests/load_balancers/session_persistence_tests.rb

34 lines
1.1 KiB
Ruby
Raw Normal View History

Shindo.tests('Fog::Rackspace::LoadBalancers | session_persistence', ['rackspace']) do
pending if Fog.mocking?
2011-07-28 14:37:21 -04:00
given_a_load_balancer_service do
given_a_load_balancer do
tests('success') do
@lb.wait_for { ready? }
tests("#set_session_persistence(#{@lb.id}, 'HTTP_COOKIE')").succeeds do
@service.set_session_persistence(@lb.id, 'HTTP_COOKIE')
end
2011-07-28 14:37:21 -04:00
@lb.wait_for { ready? }
tests("#get_session_persistence{@lb.id})").formats(SESSION_PERSISTENCE_FORMAT) do
data = @service.get_session_persistence(@lb.id).body
returns('HTTP_COOKIE') { data['sessionPersistence']['persistenceType'] }
data
end
2011-07-28 14:37:21 -04:00
@lb.wait_for { ready? }
tests("#remove_session_persistence()").succeeds do
@service.remove_session_persistence(@lb.id)
end
end
2011-07-28 14:37:21 -04:00
tests('failure') do
tests("#set_session_persistence(#{@lb.id}, 'aaa')").raises(Fog::Rackspace::LoadBalancers::BadRequest) do
2011-07-28 14:37:21 -04:00
@service.set_session_persistence(@lb.id, 'aaa')
end
end
end
end
end