--- .../controllers/provider_accounts_controller.rb | 3 +- src/app/views/catalog_entries/show.haml | 2 +- src/app/views/catalogs/show.haml | 2 +- src/app/views/pool_families/_list.haml | 2 +- src/app/views/realms/_list.haml | 2 +- src/app/views/realms/new.haml | 2 +- src/app/views/users/_list.haml | 2 +- src/app/views/users/index.haml | 2 +- src/config/navigation.rb | 2 +- src/config/routes.rb | 2 + src/features/authentication.feature | 4 +- src/features/catalog_entries.feature | 2 +- src/features/catalogs.feature | 4 +- src/features/pool_family.feature | 2 +- src/features/provider.feature | 5 +-- src/features/provider_account.feature | 31 +++++++++----------- src/features/realm.feature | 4 +- src/features/support/paths.rb | 10 +++++- src/features/user.feature | 21 ++++--------- src/spec/controllers/provider_controller_spec.rb | 4 +- 20 files changed, 52 insertions(+), 56 deletions(-)
diff --git a/src/app/controllers/provider_accounts_controller.rb b/src/app/controllers/provider_accounts_controller.rb index 1878001..b3f6394 100644 --- a/src/app/controllers/provider_accounts_controller.rb +++ b/src/app/controllers/provider_accounts_controller.rb @@ -26,7 +26,8 @@ class ProviderAccountsController < ApplicationController load_accounts
respond_to do |format| - format.html + #xml list of provider_accounts for aeolus-image, aeolus-image could work with prov. accounts list for givent provider + #to resemble html views logic, so this route could be removed (provider_accounts could be user only as nested resource) format.xml { render :text => ProviderAccount.xml_export(@provider_accounts) } end end diff --git a/src/app/views/catalog_entries/show.haml b/src/app/views/catalog_entries/show.haml index 4a5754b..3761dce 100644 --- a/src/app/views/catalog_entries/show.haml +++ b/src/app/views/catalog_entries/show.haml @@ -5,7 +5,7 @@ = link_to 'New Catalog Entry', new_catalog_entry_url, :class => 'button primary', :id => 'new_catalog_entry_button' .button-group = link_to 'Edit', edit_catalog_entry_path(@catalog_entry), :class => 'button pill', :id => 'edit_button' - = link_to "Delete", catalog_entry_path(@catalog_entry), :method => 'delete', :confirm => "Are you sure you want to delete?", :class => 'button pill danger', :id => 'delete_button' + = link_to "Delete", catalog_entry_path(@catalog_entry), :method => 'delete', :confirm => "Are you sure you want to delete?", :class => 'button pill danger', :id => 'delete'
%section.admin-content-section.user %header diff --git a/src/app/views/catalogs/show.haml b/src/app/views/catalogs/show.haml index a7c3e05..addb834 100644 --- a/src/app/views/catalogs/show.haml +++ b/src/app/views/catalogs/show.haml @@ -5,7 +5,7 @@ = link_to 'New Catalog', new_catalog_url, :class => 'button primary', :id => 'new_catalog_entry_button' .button-group = link_to 'Edit', edit_catalog_path(@catalog), :class => 'button pill', :id => 'edit_button' - = link_to "Delete", catalog_path(@catalog), :method => 'delete', :confirm => "Are you sure you want to delete?", :class => 'button pill danger', :id => 'delete_button' + = link_to "Delete", catalog_path(@catalog), :method => 'delete', :confirm => "Are you sure you want to delete?", :class => 'button pill danger', :id => 'delete'
%section.admin-content-section.user %header diff --git a/src/app/views/pool_families/_list.haml b/src/app/views/pool_families/_list.haml index d0b17d3..ebdaaee 100644 --- a/src/app/views/pool_families/_list.haml +++ b/src/app/views/pool_families/_list.haml @@ -3,7 +3,7 @@ %h2.pools Pool Families .section-controls #obj_actions - = link_to "New Pool Family", new_pool_family_path, :class => 'button pill' + = link_to "New Pool Family", new_pool_family_path, :class => 'button pill', :id => 'new_pool_family_button'
.content - content_for :form_header do diff --git a/src/app/views/realms/_list.haml b/src/app/views/realms/_list.haml index 20ecdcd..d0b2c17 100644 --- a/src/app/views/realms/_list.haml +++ b/src/app/views/realms/_list.haml @@ -1,7 +1,7 @@ .content - content_for :form_header do %li= restful_submit_tag "Delete Selected", "destroy", multi_destroy_realms_path, 'DELETE', :id => 'delete_button', :class => 'button pill danger' - %li= link_to "New Realm", new_realm_path, :id => 'new_realm', :class => 'button pill' + %li= link_to "New Realm", new_realm_path, :id => 'new_realm_button', :class => 'button pill'
= filter_table(realms_header, @realms) do |realm| %tr{:class => cycle('nostripe','stripe')} diff --git a/src/app/views/realms/new.haml b/src/app/views/realms/new.haml index a7dddaa..bff3c69 100644 --- a/src/app/views/realms/new.haml +++ b/src/app/views/realms/new.haml @@ -3,7 +3,7 @@ %h1 Create New Realm #obj_actions Return to: - = link_to "Cloud Providers", edit_provider_path(Provider.all.first, :view => 'filter', :details_tab => 'realms'), :class => 'rounded-link' + = link_to "Realms", realms_path, :class => 'rounded-link'
%section.admin-content-section.users .content diff --git a/src/app/views/users/_list.haml b/src/app/views/users/_list.haml index 4a6cece..ee66170 100644 --- a/src/app/views/users/_list.haml +++ b/src/app/views/users/_list.haml @@ -3,7 +3,7 @@ %h2#users.users Users .section-controls #obj_actions - = link_to "", new_user_path, :class => 'add-user-button' + = link_to "", new_user_path, :class => 'add-user-button', :id => 'add_user_button' .content - content_for :form_header do %li= restful_submit_tag "Delete Selected", "destroy", multi_destroy_users_path, 'DELETE', :id => 'delete_button', :class => 'button pill danger' diff --git a/src/app/views/users/index.haml b/src/app/views/users/index.haml index b13ebc9..b1bfe7f 100644 --- a/src/app/views/users/index.haml +++ b/src/app/views/users/index.haml @@ -11,7 +11,7 @@ %h2#groups.groups Groups .section-controls #obj_actions - = link_to "", "#", :class => 'add-group-button' + = link_to "", "#", :class => 'add-group-button', :id => 'add_group_button' .content Unimplemented. = render :partial => 'list' diff --git a/src/config/navigation.rb b/src/config/navigation.rb index b266438..0d5bad3 100644 --- a/src/config/navigation.rb +++ b/src/config/navigation.rb @@ -22,7 +22,7 @@ SimpleNavigation::Configuration.run do |navigation| first_level.dom_class = 'container' first_level.item :monitor, t(:monitor), pools_path, :class => 'monitor', :link => { :id => 'monitor' }, :highlights_on => //deployments|/pools|/instances/ first_level.item :administer, t(:administer), users_path, :class => 'administer' do |second_level| - second_level.item :users_and_groups, "Users & Groups", users_path, :link => { :class => 'users' }, :highlights_on => //users|/roles/ + second_level.item :users_and_groups, "Users & Groups", users_path, :link => { :class => 'users' }, :highlights_on => //users|/roles|/account/ second_level.item :environments, "Environments", pool_families_path, :link => { :class => 'environments' }, :highlights_on => //pool_families/ second_level.item :content, "Content", catalogs_path, :link => { :class => 'content' }, :highlights_on => //catalogs|/catalog_entries/ second_level.item :cloud_providers, "Cloud Providers", providers_path, :link => { :class => 'providers' }, :highlights_on => //providers|/realms|/realm_mappingsi|/hardware_profiles/ diff --git a/src/config/routes.rb b/src/config/routes.rb index d6e1a2f..68d1451 100644 --- a/src/config/routes.rb +++ b/src/config/routes.rb @@ -137,6 +137,8 @@ Conductor::Application.routes.draw do end end
+ resources :provider_accounts, :only => :index + resources :provider_types, :only => :index
resources :users do diff --git a/src/features/authentication.feature b/src/features/authentication.feature index 1dd3cf8..4a2ce82 100644 --- a/src/features/authentication.feature +++ b/src/features/authentication.feature @@ -20,7 +20,7 @@ Feature: User authentication Given I am logged in And I am on the root page When I want to edit my profile - Then should see "Editing Account" + Then should see "Edit Account" When I fill in "E-mail" with "changed@example.com" And I press "Save" Then I should be on the my user page @@ -38,7 +38,7 @@ Feature: User authentication Given I am logged in And I am on the root page When I want to edit my profile - Then should see "Editing Account" + Then should see "Edit Account" When I enter a string of length "101" into "user[login]" And I press "Save" Then I should see "Login is too long (maximum is 100 characters)" diff --git a/src/features/catalog_entries.feature b/src/features/catalog_entries.feature index 3d4ee38..59f2292 100644 --- a/src/features/catalog_entries.feature +++ b/src/features/catalog_entries.feature @@ -55,7 +55,7 @@ Feature: Manage Catalog Entries Given a catalog entry "testdepl1" exists And I am on the catalog entries page When I follow "testdepl1" - And I press "delete_button" + And I follow "delete" Then there should be only 0 catalog entries And I should be on the catalog entries page And I should not see "testdepl1" diff --git a/src/features/catalogs.feature b/src/features/catalogs.feature index caf11f1..0e3fd85 100644 --- a/src/features/catalogs.feature +++ b/src/features/catalogs.feature @@ -39,6 +39,6 @@ Feature: Manage Catalogs Given there is a "Bad" catalog And I am on the catalogs page When I follow "Bad" - And I press "Delete" + And I follow "delete" Then I should be on the catalogs page - And I should not see "Bad" \ No newline at end of file + And I should not see "Bad" diff --git a/src/features/pool_family.feature b/src/features/pool_family.feature index d873c20..a517db9 100644 --- a/src/features/pool_family.feature +++ b/src/features/pool_family.feature @@ -24,7 +24,7 @@ Feature: Pool Families Given there is a pool family named "testpoolfamily" And I am on the pool families page When I follow "testpoolfamily" - Then I should see "Properties" + Then I should see "Pool Family Details"
Scenario: Create a new Pool family Given I am on the pool families page diff --git a/src/features/provider.feature b/src/features/provider.feature index 2f0f385..5b43e6c 100644 --- a/src/features/provider.feature +++ b/src/features/provider.feature @@ -41,8 +41,7 @@ Feature: Manage Providers
Scenario: Show provider details Given there is a provider named "testprovider" - And I am on the providers page - When I follow "testprovider" + When I am on the testprovider's edit provider page Then I should see "Provider name" And I should see "Provider URL"
@@ -78,7 +77,7 @@ Feature: Manage Providers And this provider has a realm And this provider has a provider account When I go to the provider1's edit provider page - And I press "delete" + And I follow "delete" And there should not exist a provider named "provider1" And there should not be any hardware profiles And there should not be a provider account diff --git a/src/features/provider_account.feature b/src/features/provider_account.feature index c04b35b..ab1f9d9 100644 --- a/src/features/provider_account.feature +++ b/src/features/provider_account.feature @@ -31,10 +31,9 @@ Feature: Manage Provider Accounts Scenario: Create a new Provider Account Given there is a provider named "testprovider" And there are no provider accounts - When I go to the testprovider's edit provider page - And I follow "filter_view" - And I follow "New Account" - Then I should be on the new provider provider account page + And I am on the testprovider's provider accounts page + When I follow "New Account" + Then I should be on testprovider's new provider account page And I should see "New Provider Account" When I select "testprovider" from "provider_account_provider_id" And I fill in "provider_account[label]" with "testaccount" @@ -42,18 +41,16 @@ Feature: Manage Provider Accounts And I fill in "provider_account[credentials_hash][password]" with "mockpassword" And I fill in "quota[maximum_running_instances]" with "13" And I press "Save" - Then I should be on testaccount's provider account page + Then I should be on the testprovider's edit provider page And I should see "Account testaccount was added." And I should have a provider account named "testaccount" - And I should see "Properties for testaccount" - And I should see "Running instances quota: 13"
Scenario: Create a new Provider Account using wrong credentials Given there is a provider named "testprovider" And there are no provider accounts - And I am on the provider accounts page - When I follow "New Provider Account" - Then I should be on the new provider account page + And I am on the testprovider's provider accounts page + And I follow "New Account" + Then I should be on testprovider's new provider account page And I should see "New Provider Account" When I select "testprovider" from "provider_account_provider_id" And I fill in "provider_account[label]" with "testaccount" @@ -68,16 +65,16 @@ Feature: Manage Provider Accounts Given there is a provider named "testprovider" And there is a provider account named "testaccount" And the account has an instance associated with it - And I am on the provider accounts page + And I am on the testprovider's provider accounts page When I check the "testaccount" account And I press "Delete" - Then I should be on the provider accounts page + Then I should be on the testprovider's edit provider page And I should see "was not deleted" And there should be 1 provider account When I delete all instances from the account And I check the "testaccount" account And I press "Delete" - Then I should be on the provider accounts page + Then I should be on the testprovider's edit provider page And I should see "was deleted" And there should be no provider accounts
@@ -86,17 +83,17 @@ Feature: Manage Provider Accounts And there is a provider account named "testaccount" And the account has an instance associated with it And all the account instances are stopped - And I am on the provider accounts page + And I am on the testprovider's provider accounts page When I check the "testaccount" account And I press "Delete" - Then I should be on the provider accounts page + Then I should be on the testprovider's edit provider page And I should see "was deleted" And there should be no provider accounts
Scenario: Edit a existing Provider Account Given there is a provider named "testprovider" And there is a provider account named "testaccount" - And I am on the provider accounts page + And I am on the testprovider's provider accounts page And I follow "testaccount" When I follow "Edit" And I fill in "provider_account[label]" with "testaccount_updated" @@ -107,7 +104,7 @@ Feature: Manage Provider Accounts Scenario: Edit a existing Provider Account with invalid credentials Given there is a provider named "testprovider" And there is a provider account named "testaccount" - And I am on the provider accounts page + And I am on the testprovider's provider accounts page And I follow "testaccount" When I follow "Edit" And I fill in "provider_account[label]" with "" diff --git a/src/features/realm.feature b/src/features/realm.feature index 70ddc90..a59e9d2 100644 --- a/src/features/realm.feature +++ b/src/features/realm.feature @@ -12,7 +12,7 @@ Feature: Manage Realms Scenario: Create new frontend realm Given I am on the realms page When I follow "new_realm_button" - Then I should see "Create a new Realm" + Then I should see "Create New Realm" When I fill in "frontend_realm_name" with "testrealm2" And I press "Save" Then I should see "Realm was added." @@ -21,7 +21,7 @@ Feature: Manage Realms Given I am on the realms page And there is a realm "testrealm1" When I follow "new_realm_button" - Then I should see "Create a new Realm" + Then I should see "Create New Realm" When I fill in "frontend_realm_name" with "testrealm1" And I press "frontend_realm_submit" Then I should see "Name has already been taken" diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb index 4f12a4d..a849956 100644 --- a/src/features/support/paths.rb +++ b/src/features/support/paths.rb @@ -47,6 +47,9 @@ module NavigationHelpers when /^the (.*)'s edit provider page$/ edit_provider_path(Provider.find_by_name($1))
+ when /^the (.*)'s provider accounts page$/ + edit_provider_path(Provider.find_by_name($1), :view => 'filter', :details_tab => 'connectivity') + when /the settings page/ settings_path
@@ -101,8 +104,11 @@ module NavigationHelpers when /^(.*)'s edit hardware profile page$/ edit_hardware_profile_path(HardwareProfile.find_by_name($1))
- when /^(.*)'s provider account page$/ - provider_account_path(ProviderAccount.find_by_label($1)) + when /^(.*)'s provider ^(.*)'s provider account page$/ + provider_provider_account_path(Provider.find_by_name($1), ProviderAccount.find_by_label($2)) + + when /^(.*)'s new provider account page$/ + new_provider_provider_account_path(Provider.find_by_name($1))
when /the operational status of deployment page/ deployment_path(@deployment, :details_tab => 'operation') diff --git a/src/features/user.feature b/src/features/user.feature index b5e9a06..115a93f 100644 --- a/src/features/user.feature +++ b/src/features/user.feature @@ -13,7 +13,7 @@ Feature: Manage Users And there is a user "testuser" When I follow "testuser" And I follow "Edit" - Then I should see "Editing User:" + Then I should see "Edit User" When I fill in "user[password]" with "new password" And I fill in "user[password_confirmation]" with "" And I press "Save" @@ -33,15 +33,6 @@ Feature: Manage Users When I follow "testuser" Then I should be on testuser's user page
- Scenario: Administrator cancels the creation of a user account - Given I am on the users page - And there are 2 users - When I follow "New User" - Then I should be on the new user page - When I follow "cancel" - Then there should be 2 users - And I should be on the users page - Scenario: Delete users Given there is a user "testuser" And I am on the users page @@ -58,9 +49,9 @@ Feature: Manage Users
Scenario: Create new user Given I am on the users page - When I follow "New User" + When I follow "add_user_button" Then I should be on the new user page - And I should see "New Account" + And I should see "New User" When I fill in the following: | Choose a username | testuser2 | | Choose a password | secret | @@ -74,9 +65,9 @@ Feature: Manage Users
Scenario: Want to register new user but decide to cancel Given I am on the users page - When I follow "New User" + When I follow "add_user_button" Then I should be on the new user page - And I should see "New Account" + And I should see "New User" When I fill in the following: | Choose a username | testuser2 | | Choose a password | secret | @@ -84,7 +75,7 @@ Feature: Manage Users | First name | Joe | | Last name | Tester | | E-mail | testuser2@example.com | - And I follow "Cancel" + And I follow "Users & Groups" Then I should be on the users page And there should not be user with login "canceluser"
diff --git a/src/spec/controllers/provider_controller_spec.rb b/src/spec/controllers/provider_controller_spec.rb index 460ad7e..4285e0b 100644 --- a/src/spec/controllers/provider_controller_spec.rb +++ b/src/spec/controllers/provider_controller_spec.rb @@ -30,10 +30,10 @@ describe ProvidersController do
describe "provide ui to view hardware profiles" do before do - get :show, :id => @provider.id, :details_tab => 'hw_profiles', :format => :js + get :edit, :id => @provider.id, :details_tab => 'hardware_profiles', :format => :js end
- it { response.should render_template(:partial => 'providers/_hw_profiles') } + it { response.should render_template(:partial => 'hardware_profiles/_list') } it { response.should be_success } it { assigns[:hardware_profiles].size.should == @provider.hardware_profiles.size } end