-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix uninitialised constant DestinationRatePolicy exception (#943)
* fix DestinationRatePolicy namespace and add test for /destination_imports * add more check to test * add namesmapce to destination rate policy in interval data * remove extra lines * replace customer_id to destination_rate_policy_id * remove destination_rate_policy column Co-authored-by: Artem Lutsenko <[email protected]>
- Loading branch information
Showing
6 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
FactoryBot.define do | ||
factory :interval_data, class: Report::IntervalData do | ||
report { association :interval_cdr } | ||
destination_rate_policy_id { 1 } | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
spec/features/reports/interval_cdrs/show_interval_cdr_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'Show interval cdrs report' do | ||
include_context :login_as_admin | ||
|
||
let!(:report) { create(:interval_cdr) } | ||
let!(:interval_data) { create(:interval_data, report: report) } | ||
|
||
subject { visit report_interval_cdr_interval_items_path report_interval_cdr_id: report.id } | ||
|
||
it 'should have tabel with interval data and destination rate pocily' do | ||
subject | ||
expect(page).to have_table | ||
within_table_row(id: interval_data.id) do | ||
expect(page).to have_table_cell(text: 'Fixed', column: 'Destination Rate Policy') | ||
end | ||
end | ||
end |
27 changes: 27 additions & 0 deletions
27
spec/features/routing/destinations/import_destination_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'Destination imports', type: :feature do | ||
include_context :login_as_admin | ||
|
||
subject { visit destination_imports_path } | ||
|
||
context 'with importing destination items' do | ||
let!(:importing_destination) { create(:importing_destination) } | ||
|
||
it 'should have table with items' do | ||
subject | ||
expect(page).to have_table | ||
within_table_row(id: importing_destination.id) do | ||
expect(page).to have_table_cell(text: 'Fixed', column: 'Rate Policy') | ||
end | ||
end | ||
end | ||
|
||
context 'without importing destintaion items' do | ||
it 'shouldn`t have table with items' do | ||
subject | ||
expect(page).to_not have_table | ||
expect(page).to have_text('There are no Destination Imports yet.') | ||
end | ||
end | ||
end |