From: Jozef Zigmund <jzigmund(a)redhat.com>
---
src/features/catalog_entries.feature | 6 ++--
src/features/upload_files/deployable.xml | 42 ++++++++++++++++++++++++++++++
src/spec/factories/catalog_entry.rb | 2 +-
src/spec/models/catalog_entry_spec.rb | 4 +-
4 files changed, 48 insertions(+), 6 deletions(-)
create mode 100644 src/features/upload_files/deployable.xml
diff --git a/src/features/catalog_entries.feature b/src/features/catalog_entries.feature
index 94aa760..fdaa3bc 100644
--- a/src/features/catalog_entries.feature
+++ b/src/features/catalog_entries.feature
@@ -13,8 +13,8 @@ Feature: Manage Catalog Entries
When I follow "new_catalog_entry_button"
Then I should see "Add New Catalog Entry"
When I fill in "catalog_entry[name]" with "test1"
- When I fill in "catalog_entry[description]" with "description"
- When I fill in "catalog_entry[url]" with "http://random_url"
+ And I fill in "catalog_entry[description]" with "description"
+ When I attach the file "features/upload_files/deployable.xml" to
"catalog_entry[xml]"
And I press "save_button"
Then I should see "Catalog entry added"
@@ -38,7 +38,7 @@ Feature: Manage Catalog Entries
Then I should see "testdepl"
And I should see "Name"
And I should see "description"
- And I should see "url"
+ And I should see "Deployable XML"
Scenario: Delete deployables
Given there is a "default" catalog
diff --git a/src/features/upload_files/deployable.xml
b/src/features/upload_files/deployable.xml
new file mode 100644
index 0000000..c8f67e1
--- /dev/null
+++ b/src/features/upload_files/deployable.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<deployable name="my">
+ <description>This is my testing image</description>
+ <assemblies>
+ <assembly name="frontend" hwp="hwp1">
+ <image id="d4856cf0-740f-4f62-9e82-390b05040233"
build="d13681df-148b-4239-894d-cfc472d2ac64">
+ </image>
+ <services>
+ <service name="apache-server">
+ <description>Provides configuration options for the Apache
application</description>
+ <executable url="http://localhost:81/deployable.xml"
/>
+ <parameters>
+ <parameter name="hostname" type="scalar"
/>
+ <parameter name="port" type="scalar"
/>
+ </parameters>
+ </service>
+ <service name="domain-configuration">
+ <executable url="http://localhost:81/deployable.xml"
/>
+ <parameters>
+ <parameter name="domain" type="scalar"
/>
+ </parameters>
+ </service>
+ <service name="security-certificates">
+ <executable url="http://localhost:81/deployable.xml"
/>
+ <parameters>
+ <parameter name="private-key"
type="scalar" />
+ <parameter name="public-key" type="scalar"
/>
+ </parameters>
+ </service>
+ <service name="network-configuration">
+ <executable url="http://localhost:81/deployable.xml"
/>
+ <parameters>
+ <parameter name="ip-address" type="scalar"
/>
+ <parameter name="gateway" type="scalar"
/>
+ <parameter name="dns" type="scalar" />
+ <parameter name="mask" type="scalar"
/>
+ </parameters>
+ </service>
+ </services>
+ </assembly>
+ </assemblies>
+</deployable>
\ No newline at end of file
diff --git a/src/spec/factories/catalog_entry.rb b/src/spec/factories/catalog_entry.rb
index b3f7e4b..162103a 100644
--- a/src/spec/factories/catalog_entry.rb
+++ b/src/spec/factories/catalog_entry.rb
@@ -19,7 +19,7 @@
FactoryGirl.define do
factory :catalog_entry do
sequence(:name) { |n| "catalog_entry#{n}" }
- url "http://url_to_deployable"
+ xml "<?xml version=\"1.0\"?><deplyable
name='my'></deployable>"
description "catalog entry description"
association :catalog, :factory => :catalog
association :owner, :factory => :user
diff --git a/src/spec/models/catalog_entry_spec.rb
b/src/spec/models/catalog_entry_spec.rb
index ba6427a..a940f84 100644
--- a/src/spec/models/catalog_entry_spec.rb
+++ b/src/spec/models/catalog_entry_spec.rb
@@ -48,9 +48,9 @@ describe CatalogEntry do
catalog_entry2.should be_valid
end
- it "should have a url" do
+ it "should have xml content" do
catalog_entry = FactoryGirl.create :catalog_entry
- catalog_entry.url = ''
+ catalog_entry.xml = ''
catalog_entry.should_not be_valid
end
--
1.7.6.4