Small rubocop autocorrections
This commit is contained in:
@@ -61,12 +61,13 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
|
||||
end
|
||||
|
||||
def load_investments
|
||||
if params[:project_title].present?
|
||||
@investments = Budget::Investment.where("title ILIKE ?", "%#{params[:project_title].strip}%")
|
||||
else
|
||||
@investments = Budget::Investment.scoped_filter(params, @current_filter)
|
||||
@investments = if params[:project_title].present?
|
||||
Budget::Investment.where("title ILIKE ?",
|
||||
"%#{params[:project_title].strip}%")
|
||||
else
|
||||
Budget::Investment.scoped_filter(params, @current_filter)
|
||||
.order(sort_by(params[:sort_by]))
|
||||
end
|
||||
end
|
||||
@investments = @investments.page(params[:page]) unless request.format.csv?
|
||||
end
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -192,7 +192,7 @@ describe Budget do
|
||||
|
||||
describe "#generate_phases" do
|
||||
let(:drafting_phase) { budget.phases.drafting }
|
||||
let(:informing_phase) { budget.phases.informing }
|
||||
let(:informing_phase) { budget.phases.informing }
|
||||
let(:accepting_phase) { budget.phases.accepting }
|
||||
let(:reviewing_phase) { budget.phases.reviewing }
|
||||
let(:selecting_phase) { budget.phases.selecting }
|
||||
|
||||
Reference in New Issue
Block a user