diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-26 21:16:50 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-02-06 13:49:30 +0300 |
commit | 5d3816652e13cde6bf5e9de814d2c9d1e6593601 (patch) | |
tree | f6137cb0baeb01330a1729d00c059988ced600ee /spec/models | |
parent | 572fb0be9b1d45437b7c0ed1000399657f471ec7 (diff) |
Introduce maximum session time for terminal websocket connection
Store the value in application settings.
Expose the value to Workhorse.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_services/kubernetes_service_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/models/project_services/kubernetes_service_spec.rb b/spec/models/project_services/kubernetes_service_spec.rb index 4f3cd14e941..9052479d35e 100644 --- a/spec/models/project_services/kubernetes_service_spec.rb +++ b/spec/models/project_services/kubernetes_service_spec.rb @@ -181,11 +181,23 @@ describe KubernetesService, models: true, caching: true do let(:pod) { kube_pod(app: environment.slug) } let(:terminals) { kube_terminals(service, pod) } - it 'returns terminals' do - stub_reactive_cache(service, pods: [ pod, pod, kube_pod(app: "should-be-filtered-out") ]) + before do + stub_reactive_cache( + service, + pods: [ pod, pod, kube_pod(app: "should-be-filtered-out") ] + ) + end + it 'returns terminals' do is_expected.to eq(terminals + terminals) end + + it 'uses max session time from settings' do + stub_application_setting(terminal_max_session_time: 600) + + times = subject.map { |terminal| terminal[:max_session_time] } + expect(times).to eq [600, 600, 600, 600] + end end end |