Small rubocop autocorrections
This commit is contained in:
@@ -61,10 +61,11 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def load_investments
|
def load_investments
|
||||||
if params[:project_title].present?
|
@investments = if params[:project_title].present?
|
||||||
@investments = Budget::Investment.where("title ILIKE ?", "%#{params[:project_title].strip}%")
|
Budget::Investment.where("title ILIKE ?",
|
||||||
|
"%#{params[:project_title].strip}%")
|
||||||
else
|
else
|
||||||
@investments = Budget::Investment.scoped_filter(params, @current_filter)
|
Budget::Investment.scoped_filter(params, @current_filter)
|
||||||
.order(sort_by(params[:sort_by]))
|
.order(sort_by(params[:sort_by]))
|
||||||
end
|
end
|
||||||
@investments = @investments.page(params[:page]) unless request.format.csv?
|
@investments = @investments.page(params[:page]) unless request.format.csv?
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ feature 'Admin budget investments' do
|
|||||||
click_button 'Search'
|
click_button 'Search'
|
||||||
|
|
||||||
expect(page).to have_content(@investment_1.title)
|
expect(page).to have_content(@investment_1.title)
|
||||||
expect(page).to_not have_content(@investment_2.title)
|
expect(page).not_to have_content(@investment_2.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ feature 'Admin budget phases' do
|
|||||||
|
|
||||||
context 'Edit' do
|
context 'Edit' do
|
||||||
|
|
||||||
before :each do
|
before do
|
||||||
admin = create(:administrator)
|
admin = create(:administrator)
|
||||||
login_as(admin.user)
|
login_as(admin.user)
|
||||||
end
|
end
|
||||||
@@ -13,8 +13,8 @@ feature 'Admin budget phases' do
|
|||||||
scenario 'Update phase' do
|
scenario 'Update phase' do
|
||||||
visit edit_admin_budget_budget_phase_path(budget, budget.current_phase)
|
visit edit_admin_budget_budget_phase_path(budget, budget.current_phase)
|
||||||
|
|
||||||
fill_in 'start_date', with: DateTime.current + 1.days
|
fill_in 'start_date', with: Date.current + 1.days
|
||||||
fill_in 'end_date', with: DateTime.current + 12.days
|
fill_in 'end_date', with: Date.current + 12.days
|
||||||
fill_in 'budget_phase_summary', with: 'This is the summary of the phase.'
|
fill_in 'budget_phase_summary', with: 'This is the summary of the phase.'
|
||||||
fill_in 'budget_phase_description', with: 'This is the description of the phase.'
|
fill_in 'budget_phase_description', with: 'This is the description of the phase.'
|
||||||
uncheck 'budget_phase_enabled'
|
uncheck 'budget_phase_enabled'
|
||||||
@@ -23,8 +23,8 @@ feature 'Admin budget phases' do
|
|||||||
expect(page).to have_current_path(edit_admin_budget_path(budget))
|
expect(page).to have_current_path(edit_admin_budget_path(budget))
|
||||||
expect(page).to have_content 'Changes saved'
|
expect(page).to have_content 'Changes saved'
|
||||||
|
|
||||||
expect(budget.current_phase.starts_at.to_date).to eq((DateTime.current + 1.days).to_date)
|
expect(budget.current_phase.starts_at.to_date).to eq((Date.current + 1.days).to_date)
|
||||||
expect(budget.current_phase.ends_at.to_date).to eq((DateTime.current + 12.days).to_date)
|
expect(budget.current_phase.ends_at.to_date).to eq((Date.current + 12.days).to_date)
|
||||||
expect(budget.current_phase.summary).to eq('This is the summary of the phase.')
|
expect(budget.current_phase.summary).to eq('This is the summary of the phase.')
|
||||||
expect(budget.current_phase.description).to eq('This is the description of the phase.')
|
expect(budget.current_phase.description).to eq('This is the description of the phase.')
|
||||||
expect(budget.current_phase.enabled).to be(false)
|
expect(budget.current_phase.enabled).to be(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user