Ack with comments:
In ruby 1.8.6 this the following code causes an error, in 1.8.7 it works fine, but it
would be wise to make it compatible with the earlier version:
count.to_i.times.each do |i|
Replace this with:
count.to_i.times do |i|
Works fine, please change this in hardware_profile.steps and instance.steps before
pushing,
Thanks
Martyn
----- Original Message -----
From: jprovazn(a)redhat.com
To: aeolus-devel(a)lists.fedorahosted.org
Sent: Monday, 7 February, 2011 4:21:47 PM
Subject: [PATCH conductor 1/2] Cuke tests for loading instance and hardware profile with
correct id
From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/features/hardware_profile.feature | 7 +++++++
src/features/instance.feature | 7 +++++++
.../step_definitions/hardware_profile_steps.rb | 12 +++++++++++-
src/features/step_definitions/instance_steps.rb | 6 ++++++
4 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/src/features/hardware_profile.feature
b/src/features/hardware_profile.feature
index b727772..db88dcc 100644
--- a/src/features/hardware_profile.feature
+++ b/src/features/hardware_profile.feature
@@ -77,6 +77,13 @@ Feature: Manage Pools
And I should not see "m1-large"
And I should not see "m1-xlarge"
+ Scenario: Frontend HWP with correct id is displayed when id is greater than 10
+ Given there are 10 hardware profiles
+ And there is a "mock1" hardware profile
+ And I am on the the hardware profiles page
+ When I follow "mock1"
+ Then I should see "mock1(Front End)"
+
# Scenario: Create a new Hardware Profile
# Given I am an authorised user
# And I am on the hardware profiles page
diff --git a/src/features/instance.feature b/src/features/instance.feature
index 583ee49..4b3b827 100644
--- a/src/features/instance.feature
+++ b/src/features/instance.feature
@@ -109,3 +109,10 @@ Feature: Mange Instances
Then I should not see "mock"
And I should see "test"
And I should not see "other"
+
+ Scenario: Instance with correct id is displayed when id is greater than 10
+ Given there are 10 instances
+ And there is a "mock1" instance
+ And I am on the the instances page
+ When I follow "mock1"
+ Then I should see "Properties for mock1"
diff --git a/src/features/step_definitions/hardware_profile_steps.rb
b/src/features/step_definitions/hardware_profile_steps.rb
index a7a17bf..0360192 100644
--- a/src/features/step_definitions/hardware_profile_steps.rb
+++ b/src/features/step_definitions/hardware_profile_steps.rb
@@ -13,6 +13,10 @@ Given /^the Hardare Profile "([^"]*)" has the following
Provider Hardware Profil
front_end_hwp.save!
end
+Given /^there is a "([^"]*)" hardware profile$/ do |arg1|
+ Factory(:mock_hwp1, :name => arg1)
+end
+
def create_hwp(hash, provider=nil)
memory = Factory(:mock_hwp1_memory, :value => hash[:memory])
storage = Factory(:mock_hwp1_storage, :value => hash[:storage])
@@ -36,4 +40,10 @@ Given /^there are the following provider hardware profiles:$/ do
|table|
table.hashes.each do |hash|
create_hwp(hash, provider)
end
-end
\ No newline at end of file
+end
+
+Given /^there are (\d+) hardware profiles$/ do |count|
+ count.to_i.times.each do |i|
+ Factory(:mock_hwp1, :name => "hwprofile#{i}")
+ end
+end
diff --git a/src/features/step_definitions/instance_steps.rb
b/src/features/step_definitions/instance_steps.rb
index 956d3de..b8e04e1 100644
--- a/src/features/step_definitions/instance_steps.rb
+++ b/src/features/step_definitions/instance_steps.rb
@@ -78,3 +78,9 @@ Given /^there are the following instances:$/ do |table|
:private_addresses => hash['private_addresses'])
end
end
+
+Given /^there are (\d+) instances$/ do |count|
+ count.to_i.times.each do |i|
+ Factory :mock_running_instance, :name => "inst#{i}"
+ end
+end
--
1.7.3.5
_______________________________________________
aeolus-devel mailing list
aeolus-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/aeolus-devel