Small rubocop autocorrections

This commit is contained in:
Bertocq
2018-01-30 03:07:52 +01:00
parent 04d5a83031
commit 093b191f16
4 changed files with 13 additions and 12 deletions

View File

@@ -61,10 +61,11 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end
def load_investments
if params[:project_title].present?
@investments = Budget::Investment.where("title ILIKE ?", "%#{params[:project_title].strip}%")
@investments = if params[:project_title].present?
Budget::Investment.where("title ILIKE ?",
"%#{params[:project_title].strip}%")
else
@investments = Budget::Investment.scoped_filter(params, @current_filter)
Budget::Investment.scoped_filter(params, @current_filter)
.order(sort_by(params[:sort_by]))
end
@investments = @investments.page(params[:page]) unless request.format.csv?

View File

@@ -372,7 +372,7 @@ feature 'Admin budget investments' do
click_button 'Search'
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

View File

@@ -5,7 +5,7 @@ feature 'Admin budget phases' do
context 'Edit' do
before :each do
before do
admin = create(:administrator)
login_as(admin.user)
end
@@ -13,8 +13,8 @@ feature 'Admin budget phases' do
scenario 'Update phase' do
visit edit_admin_budget_budget_phase_path(budget, budget.current_phase)
fill_in 'start_date', with: DateTime.current + 1.days
fill_in 'end_date', with: DateTime.current + 12.days
fill_in 'start_date', with: Date.current + 1.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_description', with: 'This is the description of the phase.'
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_content 'Changes saved'
expect(budget.current_phase.starts_at.to_date).to eq((DateTime.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.starts_at.to_date).to eq((Date.current + 1.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.description).to eq('This is the description of the phase.')
expect(budget.current_phase.enabled).to be(false)