Skip to content

Commit

Permalink
chore bling_order_item_creator_job_spec.rb, current_done_bling_order_…
Browse files Browse the repository at this point in the history
…item_job_spec.rb and such: task #32

do not trigger callback after create to not affect the test suit time.
  • Loading branch information
Pauloparakleto committed Jan 5, 2024
1 parent 3cf302c commit 5e3b5d4
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/jobs/bling_order_item_creator_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
allow(subject).to receive(:list_status_situation).and_return([15])
end
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/canceled_bling_order_item_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
end

Expand Down
1 change: 1 addition & 0 deletions spec/jobs/checked_bling_order_items_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

describe '#perform' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
allow(Date).to receive(:today).and_return Date.new(2023, 11, 15)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.zone.now + 2.days)
end
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/current_done_bling_order_item_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
allow(Date).to receive(:today).and_return Date.new(2023, 11, 9)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
end
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/daily_canceled_order_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

describe '#perform' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
allow(Date).to receive(:today).and_return Date.new(2023, 12, 14)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.zone.now + 2.days)
FactoryBot.create(:bling_order_item, bling_order_id:, date:, situation_id:)
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/in_progress_order_items_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
end

Expand Down
1 change: 1 addition & 0 deletions spec/jobs/pending_order_items_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
end

Expand Down
1 change: 1 addition & 0 deletions spec/jobs/printed_order_items_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
BlingOrderItem.destroy_all
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
end
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/verified_bling_order_items_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
allow(Date).to receive(:today).and_return Date.new(2023, 11, 15)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.zone.now + 2.days)
end
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/weekly_canceled_order_items_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

describe '#perform_now' do
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
FactoryBot.create(:bling_datum, account_id: user.account.id, expires_at: Time.now + 2.day)
end

Expand Down
5 changes: 4 additions & 1 deletion spec/requests/bling_order_item_histories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
final_date: Date.today.strftime } }
end

before { sign_in user }
before do
allow_any_instance_of(BlingOrderItem).to receive(:synchronize_items).and_return(true)
sign_in user
end

describe 'GET /index' do
before do
Expand Down

0 comments on commit 5e3b5d4

Please sign in to comment.