diff options
| author | Robert | 2017-11-10 07:41:07 +0100 |
|---|---|---|
| committer | Robert | 2017-11-17 14:56:29 +0100 |
| commit | 5a1846208a2ef978c4582b91695be24ca5ee25cd (patch) | |
| tree | a5265d0d6d0a95622ce9352e1040232e3228c7d1 | |
| parent | 3fba11d14fb032802ea70240e4b204e93fe5a277 (diff) | |
| download | chouette-core-5a1846208a2ef978c4582b91695be24ca5ee25cd.tar.bz2 | |
Fixes #4823@1h;
- I18n.t explicit in helper so that it can be used in specs.
- Typo in spec db setup fixed and setup of blocks put into create
instead of later update.
| -rw-r--r-- | app/helpers/transport_mode_helper.rb | 2 | ||||
| -rw-r--r-- | spec/features/compliance_ckeck_sets_spec.rb | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/app/helpers/transport_mode_helper.rb b/app/helpers/transport_mode_helper.rb index b61057205..7a486fc2d 100644 --- a/app/helpers/transport_mode_helper.rb +++ b/app/helpers/transport_mode_helper.rb @@ -10,7 +10,7 @@ module TransportModeHelper private def translated_mode_name mode_type, value return "" if value.blank? - "[#{t("enumerize.transport_#{mode_type}.#{value}")}]" + "[#{I18n.t("enumerize.transport_#{mode_type}.#{value}")}]" end end diff --git a/spec/features/compliance_ckeck_sets_spec.rb b/spec/features/compliance_ckeck_sets_spec.rb index f8421eba7..9d04ef200 100644 --- a/spec/features/compliance_ckeck_sets_spec.rb +++ b/spec/features/compliance_ckeck_sets_spec.rb @@ -10,21 +10,22 @@ RSpec.describe "ComplianceCheckSets", type: :feature do # We setup a control_set with two blocks and one direct control (meaning that it is not attached to a block) # Then we add one control to the first block and two controls to the second block let( :compliance_check_set ){ create :compliance_check_set, name: random_string } - let(:blox){ - 2.times.map{ | _ | create :compliance_check_block, compliance_check_set: compliance_check_set } - } + let(:blox){[ + create( :compliance_check_block, + compliance_check_set: compliance_check_set, transport_mode: 'bus', transport_submode: 'demandAndResponseBus'), + create( :compliance_check_block, + compliance_check_set: compliance_check_set, transport_mode: 'rail', transport_submode: 'suburbanRailway') + ]} let!(:direct_checks){ make_check(nil, times: 2) + make_check(nil, severity: :error) } let!(:indirect_checks){ blox.map{ |block| make_check(block) } } context 'show' do before do - blox.first.update transport_mode: 'bus', transport_submode: 'demandAndResponseBus' - blox.second.update transport_mode: 'train', transport_submode: 'suburbanRailway' visit(compliance_check_set_path(compliance_check_set)) end - xit 'we can see the expected content' do + it 'we can see the expected content' do # Breadcrumbs expect_breadcrumb_links "Accueil", "Gestion de l'offre", " Rapports de contrôle" @@ -41,7 +42,6 @@ RSpec.describe "ComplianceCheckSets", type: :feature do expect( page ).to have_content("Objét") expect( page ).to have_content("Criticité") end - # Checks # Direct Children @@ -57,7 +57,7 @@ RSpec.describe "ComplianceCheckSets", type: :feature do # Indirect Children compliance_check_set.compliance_check_blocks.each do | block | within(:xpath, xpath_for_div_of_block(block)) do - block.checks.each do | check | + block.compliance_checks.each do | check | expect( page ).to have_content( check.code ) expect( page ).to have_content( check.name ) expect( page ).to have_content( check.criticity ) |
