1 |
b8b23c15
|
David Davis
|
require 'integration_test_helper'
|
2 |
6225eda9
|
Daniel Lobato
|
|
3 |
|
|
class ContainerIntegrationTest < ActionDispatch::IntegrationTest
|
4 |
7ff105d1
|
David Davis
|
test 'redirects to a new compute resource if none is available' do
|
5 |
6225eda9
|
Daniel Lobato
|
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 |
5274f6bc
|
Daniel Lobato
|
Fog.mock!
|
12 |
6225eda9
|
Daniel Lobato
|
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 |