1
|
require 'integration_test_helper'
|
2
|
|
3
|
class ContainerIntegrationTest < ActionDispatch::IntegrationTest
|
4
|
test 'redirects to a new compute resource if none is available' do
|
5
|
visit containers_path
|
6
|
assert_equal current_path, new_compute_resource_path
|
7
|
end
|
8
|
|
9
|
context 'available compute resource' do
|
10
|
test 'shows containers list if compute resource is available' do
|
11
|
Fog.mock!
|
12
|
ComputeResource.any_instance.stubs(:vms).returns([])
|
13
|
FactoryGirl.create(:docker_cr)
|
14
|
visit containers_path
|
15
|
assert page.has_link? 'New container'
|
16
|
refute_equal current_path, new_compute_resource_path
|
17
|
end
|
18
|
end
|
19
|
end
|