From: Tomas Sedovic <[email protected]>
---
src/features/pool.feature | 44 +++++----------------------
src/features/step_definitions/pool_steps.rb | 38 +----------------------
src/features/support/paths.rb | 2 +-
3 files changed, 11 insertions(+), 73 deletions(-)
diff --git a/src/features/pool.feature b/src/features/pool.feature
index b85b930..a3329dd 100644
--- a/src/features/pool.feature
+++ b/src/features/pool.feature
@@ -6,66 +6,38 @@ Feature: Manage Pools
Background:
Given I am an authorised user
And I am logged in
+ And I am using new UI
Scenario: Create a new Pool
Given I am on the pools page
And there is not a pool named "mockpool"
- When I follow "New pool"
- Then I should be on the new pool page
+ When I follow "New Pool"
+ Then I should be on the new resources pool page
And I should see "Create a new Pool"
When I fill in "pool_name" with "mockpool"
And I press "Save"
- Then I should be on the show pool page
+ Then I should be on the resources pool page
And I should see "Pool added"
And I should see "mockpool"
And I should have a pool named "mockpool"
- Scenario: View Pool's Hardware Profiles
- Given I have Pool Creator permissions on a pool named "mockpool"
- And the Pool has the following Hardware Profiles:
- | name | memory | cpu |storage | architecture |
- | m1-small | 1740 | 2 | 160.0 | i386 |
- | m1-large | 4096 | 4 | 850.0 | x86_64 |
- | m1-xlarge | 8192 | 8 | 1690.0 | x86_64 |
- And I am on the instances page
- When I follow "mockpool"
- Then I should be on the show pool page
- When I follow "Hardware Profiles"
- Then I should see the following:
- | m1-small | 1740 | 2 | 160.0 | i386 |
- | m1-large | 4096 | 4 | 850.0 | x86_64 |
- | m1-xlarge | 8192 | 8 | 1690.0 | x86_64 |
-
- Scenario: View Pool's Realms
- Given I have Pool Creator permissions on a pool named "mockpool"
- And the Pool has the following Realms named "Europe, United States"
- And I am on the instances page
- When I follow "mockpool"
- Then I should be on the show pool page
- When I follow "Realms"
- Then I should see "Europe"
- And I should see "United States"
-
@tag
Scenario: View Pool's Quota Usage
Given I have Pool Creator permissions on a pool named "mockpool"
- And the Pool has a quota with following capacities:
+ And the "mockpool" Pool has a quota with following capacities:
| resource | capacity |
| maximum_running_instances | 10 |
- | maximum_total_instances | 15 |
| running_instances | 8 |
- | total_instances | 15 |
- And I am on the instances page
+ And I am on the resources pools page
When I follow "mockpool"
Then I should be on the show pool page
When I follow "Quota"
Then I should see the following:
- | Running Instances | 10 | 8 |
- | Total Instances | 15 | 15 |
+ | mockpool | 10 | 80.0 |
Scenario: Enter invalid characters into Name field
Given I am an authorised user
And I am on the new pool page
When I fill in "pool[name]" with "@%&*())_...@!#!"
And I press "Save"
- Then I should see "Name must only contain: numbers, letters, spaces, '_'
and '-'"
\ No newline at end of file
+ Then I should see "Name must only contain: numbers, letters, spaces, '_'
and '-'"
diff --git a/src/features/step_definitions/pool_steps.rb
b/src/features/step_definitions/pool_steps.rb
index 5643f48..9f4a19c 100644
--- a/src/features/step_definitions/pool_steps.rb
+++ b/src/features/step_definitions/pool_steps.rb
@@ -8,46 +8,12 @@ Given /^I have Pool Creator permissions on a pool named
"([^\"]*)"$/ do |name|
Factory(:pool_creator_permission, :user => @user, :permission_object =>
@pool)
end
-Given /^the Pool has the following Hardware Profiles:$/ do |table|
- table.hashes.each do |hash|
- memory = Factory(:mock_hwp1_memory, :value => hash[:memory])
- storage = Factory(:mock_hwp1_storage, :value => hash[:storage])
- cpu = Factory(:mock_hwp1_cpu, :value => hash[:cpu])
- arch = Factory(:mock_hwp1_arch, :value => hash[:architecture])
- @pool.hardware_profiles << Factory(:mock_hwp1,
- :name => hash[:name],
- :memory => memory,
- :cpu => cpu,
- :storage => storage,
- :architecture => arch)
- end
-end
-
-Given /^the Pool has the following Realms named "([^\"]*)"$/ do |names|
- @cloud_account = Factory :mock_cloud_account
- @provider = @cloud_account.provider
-
- names.split(", ").each do |name|
- @pool.realms << Factory(:realm, :name => name, :provider => @provider)
- end
- @pool.cloud_accounts << @cloud_account
-
-end
-
-Given /^the Pool has the following Images:$/ do |table|
- table.hashes.each do |hash|
- hash["pool"] = @pool
- @pool.images << Factory(:pool_image, hash)
- end
-end
-
Given /^there is not a pool named "([^\"]*)"$/ do |name|
Pool.find_by_name(name).should be_nil
end
Then /^I should have a pool named "([^\"]*)"$/ do |name|
Pool.find_by_name(name).should_not be_nil
- Pool.find_by_name(name).permissions.size.should == 1
end
Then /^I should see the following:$/ do |table|
@@ -58,14 +24,14 @@ Then /^I should see the following:$/ do |table|
end
end
-Given /^the Pool has a quota with following capacities:$/ do |table|
+Given /^the "([^\"]*)" Pool has a quota with following capacities:$/ do
|name,table|
quota_hash = {}
table.hashes.each do |hash|
quota_hash[hash["resource"]] = hash["capacity"]
end
+ @pool = Pool.find_by_name(name)
@quota = Factory(:quota, quota_hash)
- @quota.save!
@pool.quota_id = @quota.id
@pool.save
diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
index fba0e99..66de0d2 100644
--- a/src/features/support/paths.rb
+++ b/src/features/support/paths.rb
@@ -51,7 +51,7 @@ module NavigationHelpers
new_pool_path
when /the show pool page/
- pool_path
+ resources_pool_path
when /the pool realms page/
pool_realms_path
--
1.7.3.4
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel