Update carto tests
This commit is contained in:
parent
2bab056613
commit
38091963c1
3 changed files with 19 additions and 21 deletions
|
@ -6,14 +6,14 @@ describe 'shared/dossiers/map.html.haml', type: :view do
|
|||
end
|
||||
|
||||
describe "javascript variables printing" do
|
||||
let(:dossier) { create(:dossier, :with_entreprise, json_latlngs: json_latlngs) }
|
||||
let(:dossier) { create(:dossier, json_latlngs: json_latlngs) }
|
||||
|
||||
context 'with a correct json' do
|
||||
let(:json_latlngs) { "[[{\"lat\":50.659255436656736,\"lng\":3.080635070800781},{\"lat\":50.659255436656736,\"lng\":3.079690933227539},{\"lat\":50.659962770886516,\"lng\":3.0800342559814453},{\"lat\":50.659962770886516,\"lng\":3.0811500549316406},{\"lat\":50.659255436656736,\"lng\":3.080635070800781}]]" }
|
||||
|
||||
before { subject }
|
||||
|
||||
it { expect(rendered).to have_content('dossierJsonLatLngs: [[{"lat":50.659255436656736,"lng":3.080635070800781},{"lat":50.659255436656736,"lng":3.079690933227539},{"lat":50.659962770886516,"lng":3.0800342559814453},{"lat":50.659962770886516,"lng":3.0811500549316406},{"lat":50.659255436656736,"lng":3.080635070800781}]],') }
|
||||
it { expect(rendered).to have_content('selection: [[{"lat":50.659255436656736,"lng":3.080635070800781},{"lat":50.659255436656736,"lng":3.079690933227539},{"lat":50.659962770886516,"lng":3.0800342559814453},{"lat":50.659962770886516,"lng":3.0811500549316406},{"lat":50.659255436656736,"lng":3.080635070800781}]],') }
|
||||
end
|
||||
|
||||
context 'without a correct json' do
|
||||
|
@ -21,7 +21,7 @@ describe 'shared/dossiers/map.html.haml', type: :view do
|
|||
|
||||
before { subject }
|
||||
|
||||
it { expect(rendered).to have_content('dossierJsonLatLngs: {},') }
|
||||
it { expect(rendered).to have_content('selection: {},') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,7 +23,7 @@ describe 'users/carte/show.html.haml', type: :view do
|
|||
|
||||
context 'présence des inputs hidden' do
|
||||
it 'stockage du json des polygons dessinés' do
|
||||
expect(rendered).to have_selector('input[type=hidden][id=json_latlngs][name=json_latlngs]', visible: false)
|
||||
expect(rendered).to have_selector('input[type=hidden][name=selection]', visible: false)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue