From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/controllers/deployments_controller.rb | 2 +-
src/app/views/deployments/_list.haml | 5 ++-
src/app/views/layouts/application.haml | 1 +
src/app/views/pools/_list.haml | 1 +
src/app/views/pools/_scoreboard_index.haml | 4 +-
src/features/breadcrumbs.feature | 6 +---
src/features/deployment.feature | 19 +++++++++--------
src/features/instance.feature | 5 ++-
src/features/pool.feature | 23 +++++++++++----------
src/features/step_definitions/deployment_steps.rb | 2 +-
10 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/src/app/controllers/deployments_controller.rb
b/src/app/controllers/deployments_controller.rb
index 5a036e3..53ec037 100644
--- a/src/app/controllers/deployments_controller.rb
+++ b/src/app/controllers/deployments_controller.rb
@@ -173,7 +173,7 @@ class DeploymentsController < ApplicationController
load_deployments
render :partial => 'list'
end
- format.html { redirect_to deployments_path }
+ format.html { redirect_to pools_path(:details_tab => 'deployments',
:filter_view => filter_view?) }
format.json { render :json => {:success => notices, :errors => errors} }
end
end
diff --git a/src/app/views/deployments/_list.haml b/src/app/views/deployments/_list.haml
index fe65891..7916f3b 100644
--- a/src/app/views/deployments/_list.haml
+++ b/src/app/views/deployments/_list.haml
@@ -2,7 +2,8 @@
= render :partial => '/layouts/notification'
- form_tag do
- = link_to "New Deployment", new_deployment_path, { :class =>
'button' }
+ = link_to "New Deployment", launch_new_deployments_path, { :class =>
'button' }
+ = restful_submit_tag "Stop", "multi_stop",
multi_stop_deployments_path, 'POST', :id => 'stop_button'
= label_tag "More actions"
= select_tag("more_actions",nil, :disabled => true)
@@ -49,4 +50,4 @@
%td
= deployment.pool.pool_family.name
%td
- = deployment.owner
+ = owner_name(deployment)
diff --git a/src/app/views/layouts/application.haml
b/src/app/views/layouts/application.haml
index f0f2c5c..7f0fa43 100644
--- a/src/app/views/layouts/application.haml
+++ b/src/app/views/layouts/application.haml
@@ -34,6 +34,7 @@
#content
-# works with any 960 container (.container_16 or .container_24)
= render :partial => 'layouts/nav_history'
+ = render :partial => '/layouts/notification'
= yield
%footer.standard
diff --git a/src/app/views/pools/_list.haml b/src/app/views/pools/_list.haml
index 3c7e1b8..6949fae 100644
--- a/src/app/views/pools/_list.haml
+++ b/src/app/views/pools/_list.haml
@@ -1,5 +1,6 @@
- form_tag do
= link_to "New Pool", new_pool_path, { :class => 'button' }
+ = restful_submit_tag "Destroy", "destroy",
multi_destroy_pools_path, 'DELETE', :id => 'delete_button'
= label_tag "More actions"
= select_tag("more_actions",nil, :disabled => true)
%p
diff --git a/src/app/views/pools/_scoreboard_index.haml
b/src/app/views/pools/_scoreboard_index.haml
index 45e885c..22aceb6 100644
--- a/src/app/views/pools/_scoreboard_index.haml
+++ b/src/app/views/pools/_scoreboard_index.haml
@@ -3,7 +3,7 @@
%ul.groups
%li
%dt= t("pools.index.pools")
- %dd.count.pool= @pools.count
+ %dd.count.pool= @user_pools.count
%dd.count.pool.partial= @statistics[:pools_in_use]
%li
%dt= t("deployments.deployments")
@@ -27,4 +27,4 @@
%dd.fraction.instance
%span.part 21
%span.divider.label.small.caps of
- %span.total 25
\ No newline at end of file
+ %span.total 25
diff --git a/src/features/breadcrumbs.feature b/src/features/breadcrumbs.feature
index 3fcccf4..abad08a 100644
--- a/src/features/breadcrumbs.feature
+++ b/src/features/breadcrumbs.feature
@@ -18,9 +18,7 @@ Feature: Breadcrumbs
Then I should be on the pools page
Scenario: Dont create breadcrumb when reloading or pointing to the same route
- Given a pool "testpool" exists
- And I am on the deployments page
+ Given I am on the deployments page
When I go to the pools page
- And I follow "testpool"
- When I follow "testpool"
+ And I go to the pools page
Then I should see "Deployments"
diff --git a/src/features/deployment.feature b/src/features/deployment.feature
index 67f6a62..515f3f1 100644
--- a/src/features/deployment.feature
+++ b/src/features/deployment.feature
@@ -8,18 +8,19 @@ Feature: Manage Deployments
And I am logged in
Scenario: List deployments
- Given I am on the homepage
- And there is a deployment named "MySQL Cluster" belonging to
"Databases" owned by "bob"
- When I go to the deployments page
+ Given there is a deployment named "MySQL Cluster" belonging to
"Databases" owned by "bob"
+ And I am on the pools page
+ When I follow "Filter View"
+ And I follow "Deployments"
Then I should see "MySQL Cluster"
And I should see "bob"
Scenario: List deployments over XHR
- Given I am on the homepage
- And there is a deployment named "MySQL Cluster" belonging to
"Databases" owned by "bob"
+ Given there is a deployment named "MySQL Cluster" belonging to
"Databases" owned by "bob"
+ And I am on the pools page
And I request XHR
- When I go to the deployments page
- Then I should get back a partial
+ When I follow "Filter View"
+ And I follow "Deployments"
Then I should see "MySQL Cluster"
And I should see "bob"
@@ -30,7 +31,7 @@ Feature: Manage Deployments
And there is an assembly named "testassembly" belonging to
"testdeployable"
And there is an assembly named "testassembly" belonging to
"testtemplate" template
When I go to the deployments page
- And I press "Launch new"
+ And I follow "New Deployment"
Then I should see "Launch new deployment via"
When I select "testdeployable" from "deployable_id"
When I press "Launch"
@@ -44,7 +45,7 @@ Feature: Manage Deployments
And there is an assembly named "testassembly" belonging to
"testtemplate" template
And I request XHR
When I go to the deployments page
- And I press "Launch new"
+ And I follow "New Deployment"
Then I should see "Launch new deployment via"
And I should get back a partial
When I select "testdeployable" from "deployable_id"
diff --git a/src/features/instance.feature b/src/features/instance.feature
index 92139ea..155ed21 100644
--- a/src/features/instance.feature
+++ b/src/features/instance.feature
@@ -39,8 +39,9 @@ Feature: Manage Instances
And I am on the home page
When I follow "Resource Management"
Then I should be on the pools page
- When I follow "Instances"
- Then I should be on the instances page
+ When I follow "Filter View"
+ And I follow "Instances"
+ Then I should be on the pools page
And I should see "mock1"
Scenario: I want to view all instances over XHR
diff --git a/src/features/pool.feature b/src/features/pool.feature
index 1482843..5828842 100644
--- a/src/features/pool.feature
+++ b/src/features/pool.feature
@@ -18,10 +18,7 @@ Feature: Manage Pools
And I fill in "quota_instances" with "unlimited"
And I press "Save"
Then I should be on the pool page
- And I should see "Pool added"
- And I should see "mockpool"
- And I should see "default"
- And I should see "unlimited"
+ And I should see "mockpool Pool"
And I should have a pool named "mockpool"
Scenario: Create a new Pool over XHR
@@ -58,6 +55,7 @@ Feature: Manage Pools
And a pool "Amazon Startrek Pool" exists
And a pool "Redhat Voyager Pool" exists
When I go to the pools page
+ And I follow "Filter View"
Then there should be 3 pools
When I check "Redhat Voyager Pool" pool
And I check "Amazon Startrek Pool" pool
@@ -72,7 +70,8 @@ Feature: Manage Pools
Given I am on the pools page
And there is not a pool named "mockpool"
And there is not a pool named "foopool"
- When I follow "New Pool"
+ When I follow "Filter View"
+ And I follow "New Pool"
Then I should be on the new pool page
And I should see "Create a new Pool"
When I fill in "pool_name" with "mockpool"
@@ -82,7 +81,9 @@ Feature: Manage Pools
And I should see "Pool added"
And I should see "mockpool"
And I should have a pool named "mockpool"
- When I follow "New Pool"
+ When I go to the pools page
+ And I follow "Filter View"
+ And I follow "New Pool"
Then I should be on the new pool page
And I should see "Create a new Pool"
When I fill in "pool_name" with "foopool"
@@ -90,22 +91,22 @@ Feature: Manage Pools
And I press "Save"
Then I should be on the pool page
And I should see "Pool added"
- And I should see "mockpool"
- And I should see "foopool"
And I should have a pool named "mockpool"
And I should have a pool named "foopool"
Scenario: Cannot delete default_pool
Given I am on the pools page
- When I check "default_pool" pool
+ When I follow "Filter View"
+ And I check "default_pool" pool
And I press "Destroy"
Then I should see "The default pool cannot be deleted"
And I should see "default_pool"
Scenario: Cannot delete default_pool by renaming it
Given I renamed default_pool to pool_default
- Given I am on the pools page
- When I check "pool_default" pool
+ And I am on the pools page
+ When I follow "Filter View"
+ And I check "pool_default" pool
And I press "Destroy"
Then I should see "The default pool cannot be deleted"
And I should see "pool_default"
diff --git a/src/features/step_definitions/deployment_steps.rb
b/src/features/step_definitions/deployment_steps.rb
index eeb90c5..874b612 100644
--- a/src/features/step_definitions/deployment_steps.rb
+++ b/src/features/step_definitions/deployment_steps.rb
@@ -1,5 +1,5 @@
Given /^there is a deployment named "([^"]*)" belonging to
"([^"]*)" owned by "([^"]*)"$/ do |deployment_name,
deployable_name, owner_name|
- user = Factory(:user, :login => owner_name)
+ user = Factory(:user, :login => owner_name, :last_name => owner_name)
deployable = Deployable.create!(:name => deployable_name, :owner => user)
@deployment = Deployment.create!({:name => deployment_name, :pool => Pool.first,
:owner => user, :deployable_id => deployable.id})
end
--
1.7.4