Please forget this patch. Total fail, misunderstood some parts. Will do it 
better. Sorry.

-- Ladislav

On Nov 23, 2010, at 12:56 PM, [email protected] wrote:

> From: Ladislav Martincik <[email protected]>
> 
> ---
> src/app/controllers/providers_controller.rb |    2 --
> src/app/views/providers/_providers.haml     |    2 +-
> src/app/views/providers/show.haml           |   12 +++++++++++-
> src/features/provider.feature               |   24 ++++++++++--------------
> 4 files changed, 22 insertions(+), 18 deletions(-)
> 
> diff --git a/src/app/controllers/providers_controller.rb 
> b/src/app/controllers/providers_controller.rb
> index 5ea4aee..158484d 100644
> --- a/src/app/controllers/providers_controller.rb
> +++ b/src/app/controllers/providers_controller.rb
> @@ -39,7 +39,6 @@ class ProvidersController < ApplicationController
>     @providers = Provider.list_for_user(@current_user, 
> Privilege::PROVIDER_MODIFY)
>     @provider = Provider.find(:first, :conditions => {:id => params[:id]})
>     require_privilege(Privilege::PROVIDER_MODIFY, @provider)
> -    render :show
>   end
> 
>   def new
> @@ -47,7 +46,6 @@ class ProvidersController < ApplicationController
>     @providers = Provider.list_for_user(@current_user, 
> Privilege::PROVIDER_MODIFY)
>     @provider = Provider.new(params[:provider])
>     kick_condor
> -    render :show
>   end
> 
>   def create
> diff --git a/src/app/views/providers/_providers.haml 
> b/src/app/views/providers/_providers.haml
> index 2719a7b..3969a5b 100644
> --- a/src/app/views/providers/_providers.haml
> +++ b/src/app/views/providers/_providers.haml
> @@ -9,4 +9,4 @@
>           = provider.name
>   = edit_button(@provider, controller.action_name)
>   - form_tag({:controller => 'providers', :action => 'new'}, {:method => :get 
> , :class => 'buttononly'}) do
> -    %input{ :type => 'submit', :value => t(:add), :disabled => ('disabled' 
> unless @providers.length == 0) }
> +    %input{ :type => 'submit', :value => t(:add), :disabled => ('disabled' 
> unless controller.action_name == 'index') }
> diff --git a/src/app/views/providers/show.haml 
> b/src/app/views/providers/show.haml
> index c66fabf..4be10f6 100644
> --- a/src/app/views/providers/show.haml
> +++ b/src/app/views/providers/show.haml
> @@ -1 +1,11 @@
> -= render :partial => 'form'
> += render :partial => 'providers'
> +#details.grid_13
> +  %table
> +    %thead
> +      %tr
> +        %th{:scope => "col"} Provider Name
> +        %th{:scope => "col"} Provider URL
> +    %tbody
> +      %tr
> +        %td= @provider.name
> +        %td= @provider.url
> diff --git a/src/features/provider.feature b/src/features/provider.feature
> index c332667..a2db2c8 100644
> --- a/src/features/provider.feature
> +++ b/src/features/provider.feature
> @@ -64,13 +64,11 @@ Feature: Manage Providers
>     | provider1 |
>     When I go to the providers page
>     And I follow "provider1"
> -    And I follow "Provider Accounts"
> -    And I fill in "cloud_account[label]" with "MockAccount"
> -    And I fill in "cloud_account[username]" with "mockuser"
> -    And I fill in "cloud_account[password]" with "mockpassword"
> -    And I fill in "cloud_account[account_number]" with "12345678"
> -    And I press "test_account"
> -    Then I should see "Test Connection Success: Valid Account Details"
> +    And I follow "Edit"
> +    And I fill in "provider[name]" with "MockAccount"
> +    And I fill in "provider[url]" with "http://localhost:3001/api";
> +    And I press "test_connection"
> +    Then I should see "Successfuly Connected to Provider"
> 
>   Scenario: Test Account Connection Failure
>     Given I am on the homepage
> @@ -79,10 +77,8 @@ Feature: Manage Providers
>     | provider1 |
>     When I go to the providers page
>     And I follow "provider1"
> -    And I follow "Provider Accounts"
> -    And I fill in "cloud_account[label]" with "IncorrectAccount"
> -    And I fill in "cloud_account[username]" with "incorrect_user"
> -    And I fill in "cloud_account[password]" with "incorrect_password"
> -    And I fill in "cloud_account[account_number]" with "12345678"
> -    And I press "test_account"
> -    Then I should see "Test Connection Failed: Invalid Account Details"
> \ No newline at end of file
> +    And I follow "Edit"
> +    And I fill in "provider[name]" with "MockAccount"
> +    And I fill in "provider[url]" with "http://localhost:1234/api";
> +    And I press "test_connection"
> +    Then I should see "Failed to Connect to Provider"
> -- 
> 1.7.3.1
> 
> _______________________________________________
> deltacloud-devel mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/deltacloud-devel

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to