From: Steve Linabery <slinabery(a)redhat.com>
---
src/features/provider_account.feature | 16 ++++++++++++++++
.../step_definitions/provider_account_steps.rb | 6 ++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/features/provider_account.feature
b/src/features/provider_account.feature
index 9a73bb5..cb4c2ce 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 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 |
+ When I fill in "q" with "mock"
+ And I press "Search"
+ Then I should see the following:
+ | testaccount | mockuser |
+ When I fill in "q" with "foo"
+ And I press "Search"
+ Then I should not see "testaccount"
diff --git a/src/features/step_definitions/provider_account_steps.rb
b/src/features/step_definitions/provider_account_steps.rb
index bf9991c..40d6d76 100644
--- a/src/features/step_definitions/provider_account_steps.rb
+++ b/src/features/step_definitions/provider_account_steps.rb
@@ -24,3 +24,9 @@ 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