Skip to content

Commit

Permalink
Merge pull request #1939 from alphagov/fix-broken-spec
Browse files Browse the repository at this point in the history
Fix broken spec in `domain/finders/content_spec.rb`
  • Loading branch information
robinjam authored Sep 4, 2023
2 parents 983d7ab + 96dd428 commit 4922eec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/domain/finders/content_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@
end

it "returns aggregations for a specific month" do
august2022 = Date.new(2022, 8, 1)
date = this_month_date - 6.months
month_name = Date::MONTHNAMES[date.month].downcase
create :metric, edition: edition1, date: this_month_date, upviews: 15, useful_yes: 1, useful_no: 4, searches: 10
create :metric, edition: edition1, date: august2022, upviews: 20, useful_yes: 4, useful_no: 1, searches: 1
create :metric, edition: edition2, date: august2022, upviews: 10, useful_yes: 4, useful_no: 1, searches: 11
create :metric, edition: edition1, date:, upviews: 20, useful_yes: 4, useful_no: 1, searches: 1
create :metric, edition: edition2, date:, upviews: 10, useful_yes: 4, useful_no: 1, searches: 11

recalculate_aggregations!

response = described_class.call(filter: filter.merge(date_range: "august-2022"))
response = described_class.call(filter: filter.merge(date_range: "#{month_name}-#{date.year}"))

expect(response[:results]).to contain_exactly(
hash_including(upviews: 20, searches: 1, satisfaction: 0.8),
Expand Down

0 comments on commit 4922eec

Please sign in to comment.