mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
Fix performance of report builder spec (#6024)
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -162,6 +162,8 @@ group :test do
|
||||
gem 'database_cleaner'
|
||||
# mock http calls
|
||||
gem 'webmock'
|
||||
# test profiling
|
||||
gem 'test-prof'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
|
||||
@@ -656,6 +656,7 @@ GEM
|
||||
statsd-ruby (1.5.0)
|
||||
stripe (6.5.0)
|
||||
telephone_number (1.4.16)
|
||||
test-prof (1.0.11)
|
||||
thor (1.2.1)
|
||||
tilt (2.0.10)
|
||||
time_diff (0.3.0)
|
||||
@@ -815,6 +816,7 @@ DEPENDENCIES
|
||||
squasher
|
||||
stripe
|
||||
telephone_number
|
||||
test-prof
|
||||
time_diff
|
||||
twilio-ruby (~> 5.66)
|
||||
twitty
|
||||
|
||||
@@ -2,15 +2,16 @@ require 'rails_helper'
|
||||
|
||||
describe ::V2::ReportBuilder do
|
||||
include ActiveJob::TestHelper
|
||||
let!(:account) { create(:account) }
|
||||
let!(:user) { create(:user, account: account) }
|
||||
let!(:inbox) { create(:inbox, account: account) }
|
||||
let(:inbox_member) { create(:inbox_member, user: user, inbox: inbox) }
|
||||
let!(:label_1) { create(:label, title: 'Label_1', account: account) }
|
||||
let!(:label_2) { create(:label, title: 'Label_2', account: account) }
|
||||
let_it_be(:account) { create(:account) }
|
||||
let_it_be(:label_1) { create(:label, title: 'Label_1', account: account) }
|
||||
let_it_be(:label_2) { create(:label, title: 'Label_2', account: account) }
|
||||
|
||||
describe '#timeseries' do
|
||||
before do
|
||||
before_all do
|
||||
user = create(:user, account: account)
|
||||
inbox = create(:inbox, account: account)
|
||||
create(:inbox_member, user: user, inbox: inbox)
|
||||
|
||||
gravatar_url = 'https://www.gravatar.com'
|
||||
stub_request(:get, /#{gravatar_url}.*/).to_return(status: 404)
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ require 'rspec/rails'
|
||||
require 'pundit/rspec'
|
||||
require 'sidekiq/testing'
|
||||
|
||||
# test-prof helpers for tests optimization
|
||||
require 'test_prof/recipes/rspec/before_all'
|
||||
require 'test_prof/recipes/rspec/let_it_be'
|
||||
|
||||
# Add additional requires below this line. Rails is not loaded until this point!
|
||||
|
||||
# Requires supporting ruby files with custom matchers and macros, etc, in
|
||||
|
||||
Reference in New Issue
Block a user