on launch from catalog page
https://bugzilla.redhat.com/show_bug.cgi?id=770445
---
.../deployments/launch_from_catalog.html.haml | 12 +++++-------
src/features/deployment.feature | 18 ++++++++++++++++++
src/features/step_definitions/catalog_steps.rb | 4 ++++
.../step_definitions/hardware_profile_steps.rb | 5 +++++
src/features/support/paths.rb | 3 +++
5 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/src/app/views/deployments/launch_from_catalog.html.haml
b/src/app/views/deployments/launch_from_catalog.html.haml
index 2845309..ce35cf2 100644
--- a/src/app/views/deployments/launch_from_catalog.html.haml
+++ b/src/app/views/deployments/launch_from_catalog.html.haml
@@ -29,15 +29,13 @@
%th=t'.arch'
%th
%strong=t'.deployable_xml'
- -deployable.fetch_images.compact.each do |image|
+ -deployable.get_image_details.each do |assembly|
%tr
%td
- %strong= image.id
- %td= deployable.hw_profile_for_image(image.id).name
- %td= deployable.hw_profile_for_image(image.id).storage
- %td= deployable.hw_profile_for_image(image.id).memory
- %td= deployable.hw_profile_for_image(image.id).architecture
- %td= link_to deployable.xml_filename,
catalog_deployable_path(deployable.catalogs.first, deployable.id, :deployable_xml =>
true)
+ %strong= assembly[:image_uuid]
+ -%w{hwp_name hwp_hdd hwp_ram hwp_arch}.map(&:to_sym).each do
|property|
+ %td= assembly[property]
+ %td= link_to deployable.xml_filename,
catalog_deployable_path(deployable.catalogs.first, deployable.id, :deployable_xml =>
true)
- else
#no-catalog-entry.align-center
%strong= t(".no_catalog_entry")
diff --git a/src/features/deployment.feature b/src/features/deployment.feature
index 518660f..3342bc6 100644
--- a/src/features/deployment.feature
+++ b/src/features/deployment.feature
@@ -265,3 +265,21 @@ Feature: Manage Deployments
And I press "apply_deployments_search"
Then I should see "mydeployment"
And I should not see "somedeployment"
+
+ Scenario: Launch from catalog page
+ Given there is a "catalog" catalog with deployable
+ And there is a "front_hwp1" hardware profile
+ And there is a "front_hwp2" hardware profile
+ When I am on the launch from the catalog "catalog" page
+ Then I should see "my"
+ And I should see "front_hwp1"
+ And I should see "front_hwp2"
+
+ Scenario: Launch from catalog page with hardware profile missing
+ Given there is a "catalog" catalog with deployable
+ And there is no "front_hwp1" hardware profile
+ And there is a "front_hwp2" hardware profile
+ When I am on the launch from the catalog "catalog" page
+ Then I should see "my"
+ And I should not see "front_hwp1"
+ And I should see "front_hwp2"
diff --git a/src/features/step_definitions/catalog_steps.rb
b/src/features/step_definitions/catalog_steps.rb
index 9eb2aa9..3dcb34f 100644
--- a/src/features/step_definitions/catalog_steps.rb
+++ b/src/features/step_definitions/catalog_steps.rb
@@ -17,6 +17,10 @@ Given /^there is a "([^"]*)" catalog$/ do |name|
FactoryGirl.create :catalog, :name => name
end
+Given /^there is a "([^"]*)" catalog with deployable$/ do |name|
+ FactoryGirl.create :catalog_with_deployable, :name => name
+end
+
When /^I check "([^"]*)" catalog$/ do |arg1|
catalog = Catalog.find_by_name(arg1)
check("catalog_checkbox_#{catalog.id}")
diff --git a/src/features/step_definitions/hardware_profile_steps.rb
b/src/features/step_definitions/hardware_profile_steps.rb
index 22e875b..06d3ee1 100644
--- a/src/features/step_definitions/hardware_profile_steps.rb
+++ b/src/features/step_definitions/hardware_profile_steps.rb
@@ -29,6 +29,11 @@ Given /^there is a "([^"]*)" hardware profile$/ do
|arg1|
FactoryGirl.create(:mock_hwp1, :name => arg1)
end
+Given /^there is no "([^"]+)" hardware profile$/ do |arg1|
+ hwp = HardwareProfile.find_by_name($1)
+ hwp.destroy if hwp
+end
+
def create_hwp(hash, provider=nil)
memory = FactoryGirl.create(:mock_hwp_fake_memory, :value => hash[:memory])
storage = FactoryGirl.create(:mock_hwp_fake_storage, :value => hash[:storage])
diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
index 5e73bd0..f377f53 100644
--- a/src/features/support/paths.rb
+++ b/src/features/support/paths.rb
@@ -95,6 +95,9 @@ module NavigationHelpers
when /the deployments page/
deployments_path
+ when /the launch from the catalog "([^"]*)" page/
+ launch_from_catalog_deployments_path(:catalog_id =>
Catalog.find_by_name($1).id)
+
when /the instances page/
instances_path
--
1.7.7.5