ACK

On 01/03/2011 05:50 PM, [email protected] wrote:
> From: Ladislav Martincik<[email protected]>
>
> ---
>   src/features/provider.feature                   |   68 
> ++++++-----------------
>   src/features/step_definitions/provider_steps.rb |    5 ++
>   2 files changed, 23 insertions(+), 50 deletions(-)
>
> diff --git a/src/features/provider.feature b/src/features/provider.feature
> index 8cf2ccd..9e6f398 100644
> --- a/src/features/provider.feature
> +++ b/src/features/provider.feature
> @@ -6,6 +6,7 @@ Feature: Manage Providers
>     Background:
>       Given I am an authorised user
>       And I am logged in
> +    And I am using new UI
>
>     Scenario: List providers
>       Given I am on the homepage
> @@ -14,7 +15,7 @@ Feature: Manage Providers
>       | provider1 |
>       | provider2 |
>       | provider3 |
> -    When I go to the providers page
> +    When I go to the admin providers page
>       Then I should see the following:
>       | provider1 |
>       | provider2 |
> @@ -22,73 +23,41 @@ Feature: Manage Providers
>
>     Scenario: Show provider details
>       Given there is a provider named "testprovider"
> -    And I am on the providers page
> +    And I am on the admin providers page
>       When I follow "testprovider"
> -    Then I should see "Provider Name"
> +    Then I should see "Provider name"
>       And I should see "Provider URL"
>
>     Scenario: Create a new Provider
> -    Given I am on the providers page
> +    Given I am on the admin providers page
>       And there is not a provider named "testprovider"
> -    When I press "Add"
> -    Then I should be on the new provider page
> +    When I follow "Create"
> +    Then I should be on the new admin provider page
>       When I fill in "provider[name]" with "testprovider"
>       And I fill in "provider[url]" with "http://localhost:3001/api";
> -    And I press "add_provider"
> -    Then I should be on the show provider page
> +    And I press "Save"
> +    Then I should be on the admin providers page
>       And I should see "Provider added"
>       And I should have a provider named "testprovider"
>
>     Scenario: Test Provider Connection Successful
> -    Given I am on the providers page
> -    When I press "Add"
> -    Then I should be on the new provider page
> +    Given I am on the admin providers page
> +    When I follow "Create"
> +    Then I should be on the new admin provider page
>       When I fill in "provider[name]" with "testprovider"
>       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 Provider Connection Failure
> -    Given I am on the providers page
> -    When I press "Add"
> -    Then I should be on the new provider page
> +    Given I am on the admin providers page
> +    When I follow "Create"
> +    Then I should be on the new admin provider page
>       When I fill in "provider[name]" with "incorrect_provider"
>       And I fill in "provider[url]" with "http://incorrecthost:3001/api";
>       And I press "test_connection"
>       Then I should see "Failed to Connect to Provider"
>
> -  Scenario: Test Account Connection Success
> -    Given I am on the homepage
> -    And there are these providers:
> -    | name      |
> -    | provider1 |
> -    When I go to the providers page
> -    And I follow "provider1"
> -    And I follow "Provider Accounts"
> -    And I follow "Add" within "#details"
> -    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"
> -
> -  Scenario: Test Account Connection Failure
> -    Given I am on the homepage
> -    And there are these providers:
> -    | name      |
> -    | provider1 |
> -    When I go to the providers page
> -    And I follow "provider1"
> -    And I follow "Provider Accounts"
> -    And I follow "Add" within "#details"
> -    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"
> -
>     Scenario: Delete a provider
>       Given I am on the homepage
>       And there is a provider named "provider1"
> @@ -96,10 +65,9 @@ Feature: Manage Providers
>       And this provider has 5 hardware profiles
>       And this provider has a realm
>       And this provider has a cloud account
> -    When I go to the providers page
> -    And I follow "provider1"
> -    And I press "delete"
> -    Then I should see "Provider Deleted"
> +    When I go to the admin providers page
> +    And I check "provider1" provider
> +    And I press "Delete"
>       And there should not exist a provider named "provider1"
>       And there should not be any replicated images
>       And there should not be any hardware profiles
> diff --git a/src/features/step_definitions/provider_steps.rb 
> b/src/features/step_definitions/provider_steps.rb
> index abc4662..2673ae8 100644
> --- a/src/features/step_definitions/provider_steps.rb
> +++ b/src/features/step_definitions/provider_steps.rb
> @@ -25,6 +25,11 @@ When /^I delete provider$/ do
>     click_button "Delete provider"
>   end
>
> +When /^(?:|I )check "([^"]*)" provider$/ do |provider_name|
> +  provider = Provider.find_by_name(provider_name)
> +  check("provider_checkbox_#{provider.id}")
> +end
> +
>   Given /^there are these providers:$/ do |table|
>     table.hashes.each do |hash|
>       Factory(:mock_provider, :name =>  hash['name'])

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

Reply via email to