Remove isolated useless assignments

These variables can be considered a block, and so removing them doesn't
make the test much harder to undestand.

Sometimes these variables formed the setup, sometimes they formed an
isolated part of the setup, and sometimes they were the part of the test
that made the test different from other tests.
This commit is contained in:
Javi Martín
2019-09-27 03:00:58 +02:00
parent 802be29773
commit 9f64129be5
12 changed files with 63 additions and 57 deletions

View File

@@ -64,9 +64,9 @@ describe Admin::Api::StatsController do
time_1 = Time.zone.local(2017, 04, 01)
time_2 = Time.zone.local(2017, 04, 02)
budget_investment1 = create(:budget_investment, created_at: time_1)
budget_investment2 = create(:budget_investment, created_at: time_2)
budget_investment3 = create(:budget_investment, created_at: time_2)
create(:budget_investment, created_at: time_1)
create(:budget_investment, created_at: time_2)
create(:budget_investment, created_at: time_2)
sign_in user
get :show, params: { budget_investments: true }