From: Steve Linabery <slinabery(a)redhat.com>
---
src/features/provider_account.feature | 16 ++++++++++++++++
.../step_definitions/provider_account_steps.rb | 12 ++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/src/features/provider_account.feature
b/src/features/provider_account.feature
index 9a73bb5..964aba2 100644
--- a/src/features/provider_account.feature
+++ b/src/features/provider_account.feature
@@ -68,3 +68,19 @@ Feature: Manage Provider Accounts
And I press "Delete"
Then I should be on the admin provider accounts page
And there should be no provider accounts
+
+ Scenario: Search for Provider Accounts
+ Given there is a provider named "testprovider"
+ And there is a provider account named "testaccount"
+ And there is a second provider account named "otheraccount"
+ And I am on the admin provider accounts page
+ When I fill in "q" with "test"
+ And I press "Search"
+ Then I should see the following:
+ | testaccount | mockuser |
+ And I should not see "otheraccount"
+ When I fill in "q" with "mock"
+ And I press "Search"
+ Then I should see the following:
+ | testaccount | mockuser |
+ | otheraccount | mockuser |
diff --git a/src/features/step_definitions/provider_account_steps.rb
b/src/features/step_definitions/provider_account_steps.rb
index bf9991c..5d68b88 100644
--- a/src/features/step_definitions/provider_account_steps.rb
+++ b/src/features/step_definitions/provider_account_steps.rb
@@ -20,7 +20,19 @@ Given /^there is a provider account named "([^"]*)"$/ do
|label|
@cloud_account = Factory(:mock_cloud_account, :provider => @provider, :label =>
label)
end
+Given /^there is a second provider account named "([^"]*)"$/ do |label|
+ @provider = Factory(:mock_provider, :name => 'secondprovider')
+ @cloud_account = Factory(:mock_cloud_account, :provider => @provider, :label =>
label)
+end
+
+
When /^I check the "([^"]*)" account$/ do |label|
account = CloudAccount.find_by_label(label)
check("account_checkbox_#{account.id}")
end
+
+Given /^that there are these provider accounts:$/ do |table|
+ table.hashes.each do |hash|
+ Factory.create(:cloud_account, :name => hash['name'], :username =>
hash['username'])
+ end
+end
--
1.7.3.4