Remove the unused ModuleApiCarto#classes method

This commit is contained in:
gregoirenovel 2018-10-15 15:44:34 +02:00
parent 8fa9b303ad
commit 1f0af303f3
2 changed files with 0 additions and 54 deletions

View file

@ -4,18 +4,4 @@ class ModuleAPICarto < ApplicationRecord
validates :use_api_carto, presence: true, allow_blank: true, allow_nil: false validates :use_api_carto, presence: true, allow_blank: true, allow_nil: false
validates :quartiers_prioritaires, presence: true, allow_blank: true, allow_nil: false validates :quartiers_prioritaires, presence: true, allow_blank: true, allow_nil: false
validates :cadastre, presence: true, allow_blank: true, allow_nil: false validates :cadastre, presence: true, allow_blank: true, allow_nil: false
def classes
modules = ''
if quartiers_prioritaires?
modules += 'qp '
end
if cadastre?
modules += 'cadastre '
end
modules
end
end end

View file

@ -10,44 +10,4 @@ describe ModuleAPICarto do
it { is_expected.to have_db_column(:quartiers_prioritaires) } it { is_expected.to have_db_column(:quartiers_prioritaires) }
it { is_expected.to have_db_column(:cadastre) } it { is_expected.to have_db_column(:cadastre) }
end end
describe '#classes' do
let(:module_api_carto) { create(:module_api_carto, quartiers_prioritaires: qp, cadastre: cadastre) }
context 'when module api carto qp is true' do
let(:qp) { true }
let(:cadastre) { false }
subject { module_api_carto.classes }
it { is_expected.to eq 'qp ' }
end
context 'when module api carto cadastre is true' do
let(:qp) { false }
let(:cadastre) { true }
subject { module_api_carto.classes }
it { is_expected.to eq 'cadastre ' }
end
context 'when module api carto qp is true and cadastre is true' do
let(:qp) { true }
let(:cadastre) { true }
subject { module_api_carto.classes }
it { is_expected.to eq 'qp cadastre ' }
end
context 'when module api carto qp is false and cadastre is false' do
let(:qp) { false }
let(:cadastre) { false }
subject { module_api_carto.classes }
it { is_expected.to eq '' }
end
end
end end