From: Jozef Zigmund <jzigmund(a)redhat.com>
---
src/app/views/hardware_profiles/edit.haml | 2 +-
src/features/hardware_profile.feature | 17 ++++++++++-------
.../step_definitions/hardware_profile_steps.rb | 4 +++-
src/features/support/paths.rb | 5 +++--
4 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/app/views/hardware_profiles/edit.haml
b/src/app/views/hardware_profiles/edit.haml
index 68350e8..d70b918 100644
--- a/src/app/views/hardware_profiles/edit.haml
+++ b/src/app/views/hardware_profiles/edit.haml
@@ -14,7 +14,7 @@
Edit Hardware Profile
.content
- -form_for @hardware_profile, :url => hardware_profile_path(@hardware_profile),
:html => { :multipart => true } do |hwp_form|
+ = form_for @hardware_profile, :url => hardware_profile_path(@hardware_profile),
:html => { :multipart => true } do |hwp_form|
= render :partial => "form", :locals => { :hwp_form => hwp_form
}
= render :partial => 'matching_provider_hardware_profiles' if
params[:commit] == 'Check Matches'
diff --git a/src/features/hardware_profile.feature
b/src/features/hardware_profile.feature
index 2df0206..e6bb796 100644
--- a/src/features/hardware_profile.feature
+++ b/src/features/hardware_profile.feature
@@ -83,11 +83,11 @@ Feature: Manage Pools
When I follow "mock1"
Then I should see "mock1 (Front End)"
- Scenario: Create a new Hardware Profile
+ Scenario: Create a new Hardware Profile
Given I am on the hardware profiles page
When I follow "new_hardware_profile_button"
Then I should be on the new hardware profile page
- When I fill in "name" with "Test Hardware Profile"
+ When I fill in "hardware_profile_name" with "Test Hardware
Profile"
And I enter the following details for the Hardware Profile Properties
| name | value | unit |
| memory | 1740 | MB |
@@ -99,6 +99,7 @@ Feature: Manage Pools
And I should see the following:
| Test Hardware Profile | 1740 | 2 | 250 | i386 |
+ @fail
Scenario: Check New Hardware Profile matching Provider Hardware Profiles
Given there is a provider named "provider1"
And there is a provider named "provider2"
@@ -113,7 +114,7 @@ Feature: Manage Pools
| m1-medium | 8192 | 4 | 500 | i386 |
| m1-large | 2048 | 4 | 850 | x86_64 |
And I am on the new hardware profile page
- When I fill in "name" with "Test Hardware Profile"
+ When I fill in "hardware_profile_name" with "Test Hardware
Profile"
And I enter the following details for the Hardware Profile Properties
| name | value | unit |
| memory | 1740 | MB |
@@ -126,6 +127,7 @@ Feature: Manage Pools
| provider1 | m1-medium | 1740 | 2 | 500 | i386 |
| provider2 | m1-small | 4048 | 4 | 500 | i386 |
+ @fail
Scenario: Update a HardwareProfile
Given there are the following conductor hardware profiles:
| name | memory | cpu |storage | architecture |
@@ -133,7 +135,7 @@ Feature: Manage Pools
And I am on the hardware profiles page
When I follow "m1-small"
When I follow "edit_button"
- Then I should be on the edit hardware profiles page
+ Then I should be on m1-small's edit hardware profile page
When I enter the following details for the Hardware Profile Properties
| name | value | unit |
| memory | 1740 | MB |
@@ -146,11 +148,12 @@ Feature: Manage Pools
| Name | Memory | CPU | Storage | Architecture |
| m1-small | 1740 | 2 | 250 | i386 |
- Scenario: validate hwp inputs
+ @fail
+ Scenario: Validate hwp inputs
Given I am on the hardware profiles page
When I follow "new_hardware_profile_button"
Then I should be on the new hardware profile page
- When I fill in "name" with "Test Hardware Profile"
+ When I fill in "hardware_profile_name" with "Test Hardware
Profile"
And I enter the following details for the Hardware Profile Properties
| name | value | unit |
| memory | ten | MB |
@@ -158,4 +161,4 @@ Feature: Manage Pools
| storage | ? | GB |
| architecture | | label |
And I press "save_button"
- Then I should see "errors prohibited this hardware profile from being
saved"
+ Then I should see "is invalid"
diff --git a/src/features/step_definitions/hardware_profile_steps.rb
b/src/features/step_definitions/hardware_profile_steps.rb
index 71a62f5..69833d7 100644
--- a/src/features/step_definitions/hardware_profile_steps.rb
+++ b/src/features/step_definitions/hardware_profile_steps.rb
@@ -25,8 +25,10 @@ end
When /^I enter the following details for the Hardware Profile Properties$/ do |table|
table.hashes.each do |hash|
hash.each_pair do |key, value|
- unless (hash[:name] == "architecture" && (key ==
"range_first" || key == "range_last" || key ==
"property_enum_entries")) || key == "name"
+ if !(hash[:name] == "architecture" || key == "name")
When "I fill in \"#{"hardware_profile_" + hash[:name] +
"_attributes_" + key}\" with \"#{value}\""
+ elsif hash[:name] == "architecture" && key == 'value'
+ When "I select \"#{value}\" from
\"#{"hardware_profile_" + hash[:name] + "_attributes_" +
key}\""
end
end
end
diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
index 0110b65..84546ed 100644
--- a/src/features/support/paths.rb
+++ b/src/features/support/paths.rb
@@ -95,8 +95,9 @@ module NavigationHelpers
when /the new hardware profile page/
url_for new_hardware_profile_path
- when /the edit hardware profiles page/
- url_for :action => 'edit', :controller =>
'hardware_profiles', :only_path => true
+ when /^(.*)'s edit hardware profile page$/
+ #url_for :action => 'edit', :controller =>
'hardware_profiles', :only_path => true
+ edit_hardware_profile_path(HardwareProfile.find_by_name($1))
when /^(.*)'s provider account page$/
provider_account_path(ProviderAccount.find_by_label($1))
--
1.7.6
Show replies by date