Add search form for Admin::BudgetInvestments (#2336)

This commit is contained in:
Angel Perez
2018-01-24 08:58:32 -04:00
parent c08edf044d
commit 680ca46ef1
6 changed files with 47 additions and 2 deletions

View File

@@ -338,6 +338,27 @@ feature 'Admin budget investments' do
end
context 'Search' do
background do
@budget = create(:budget)
@investment_1 = create(:budget_investment, title: "Some investment", budget: @budget)
@investment_2 = create(:budget_investment, title: "Some other investment", budget: @budget)
end
scenario "Search investments by title" do
visit admin_budget_budget_investments_path(@budget)
expect(page).to have_content(@investment_1.title)
expect(page).to have_content(@investment_2.title)
fill_in 'project_title', with: 'Some investment'
click_button 'Search'
expect(page).to have_content(@investment_1.title)
expect(page).to_not have_content(@investment_2.title)
end
end
context 'Show' do
background do
@administrator = create(:administrator, user: create(:user, username: 'Ana', email: 'ana@admins.org'))