Skip to content

Commit

Permalink
Fix review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Aug 8, 2022
1 parent 2dd7928 commit 031453c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/services/billing_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def call
private

def today
@today ||= Time.zone.now
@today ||= Time.current
end

# NOTE: Retrieve list of subscription that should be billed today
# NOTE: Retrieve list of subscriptions that should be billed today
def billable_subscriptions
sql = []

Expand Down
20 changes: 10 additions & 10 deletions spec/services/billing_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

before { subscription }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
current_date = DateTime.parse('20 Jun 2022')

travel_to(current_date) do
Expand All @@ -52,7 +52,7 @@
let(:interval) { :monthly }
let(:billing_time) { :calendar }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
current_date = DateTime.parse('01 Feb 2022')

travel_to(current_date) do
Expand All @@ -76,7 +76,7 @@
let(:interval) { :yearly }
let(:billing_time) { :calendar }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
current_date = DateTime.parse('01 Jan 2022')

travel_to(current_date) do
Expand Down Expand Up @@ -119,7 +119,7 @@

let(:current_date) { DateTime.parse('20 Jun 2022').prev_occurring(subscription_date.strftime('%A').downcase.to_sym) }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
travel_to(current_date) do
billing_service.call

Expand All @@ -140,7 +140,7 @@
let(:billing_time) { :anniversary }
let(:current_date) { subscription_date.next_month }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
travel_to(current_date) do
billing_service.call

Expand All @@ -159,7 +159,7 @@
let(:subscription_date) { DateTime.parse('31 Mar 2021') }
let(:current_date) { DateTime.parse('28 Feb 2022') }

it 'enqueue a job if the month count less than 31 days' do
it 'enqueues a job if the month count less than 31 days' do
travel_to(current_date) do
billing_service.call

Expand All @@ -176,7 +176,7 @@

let(:current_date) { subscription_date.next_year }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
travel_to(current_date) do
billing_service.call

Expand All @@ -195,7 +195,7 @@
let(:subscription_date) { DateTime.parse('29 Feb 2020') }
let(:current_date) { DateTime.parse('28 Feb 2022') }

it 'enqueue a job on 28th of february when year is not a leap year' do
it 'enqueues a job on 28th of february when year is not a leap year' do
travel_to(current_date) do
billing_service.call

Expand All @@ -222,7 +222,7 @@
let(:subscription_date) { DateTime.parse('31 Mar 2021') }
let(:current_date) { DateTime.parse('28 Feb 2022') }

it 'enqueue a job if the month count less than 31 days' do
it 'enqueues a job if the month count less than 31 days' do
travel_to(current_date) do
billing_service.call

Expand Down Expand Up @@ -255,7 +255,7 @@

before { subscription }

it 'enqueue a job on billing day' do
it 'enqueues a job on billing day' do
current_date = DateTime.parse('01 Feb 2022')

travel_to(current_date) do
Expand Down

0 comments on commit 031453c

Please sign in to comment.