mirror of
https://github.com/we-promise/sure.git
synced 2026-08-05 16:42:18 +00:00
Some improvements
- Fix issue with lunch flow accounts that were imported - Remove the period comparison section from reports
This commit is contained in:
@@ -76,14 +76,6 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_select "h3", text: I18n.t("reports.summary.net_savings")
|
||||
end
|
||||
|
||||
test "index builds comparison data" do
|
||||
get reports_path(period_type: :monthly)
|
||||
assert_response :ok
|
||||
assert_select "h2", text: I18n.t("reports.comparison.title")
|
||||
assert_select "h3", text: I18n.t("reports.comparison.income")
|
||||
assert_select "h3", text: I18n.t("reports.comparison.expenses")
|
||||
end
|
||||
|
||||
test "index builds trends data" do
|
||||
get reports_path(period_type: :monthly)
|
||||
assert_response :ok
|
||||
|
||||
@@ -45,25 +45,11 @@ class PeriodTest < ActiveSupport::TestCase
|
||||
assert_equal "Custom Period", period.label
|
||||
end
|
||||
|
||||
test "comparison_label returns correct label for known period" do
|
||||
period = Period.from_key("last_30_days")
|
||||
assert_equal "vs. last month", period.comparison_label
|
||||
end
|
||||
|
||||
test "comparison_label returns date range for unknown period" do
|
||||
start_date = Date.current - 15.days
|
||||
end_date = Date.current
|
||||
period = Period.new(start_date: start_date, end_date: end_date)
|
||||
expected = "#{start_date.strftime("%b %d, %Y")} to #{end_date.strftime("%b %d, %Y")}"
|
||||
assert_equal expected, period.comparison_label
|
||||
end
|
||||
|
||||
test "all_time period can be created" do
|
||||
period = Period.from_key("all_time")
|
||||
assert_equal "all_time", period.key
|
||||
assert_equal "All Time", period.label
|
||||
assert_equal "All", period.label_short
|
||||
assert_equal "vs. beginning", period.comparison_label
|
||||
end
|
||||
|
||||
test "all_time period uses family's oldest entry date" do
|
||||
|
||||
Reference in New Issue
Block a user