2018-08-08 15:39:18 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Champs::CheckboxChamp do
|
|
|
|
let(:checkbox) { Champs::CheckboxChamp.new(value: value) }
|
|
|
|
|
|
|
|
describe '#to_s' do
|
|
|
|
subject { checkbox.to_s }
|
|
|
|
|
|
|
|
context 'when the value is on' do
|
|
|
|
let(:value) { 'on' }
|
|
|
|
|
2018-12-28 15:58:17 +01:00
|
|
|
it { is_expected.to eq('Oui') }
|
2018-08-08 15:39:18 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when the value is off' do
|
|
|
|
let(:value) { 'off' }
|
|
|
|
|
2018-12-28 15:58:17 +01:00
|
|
|
it { is_expected.to eq('Non') }
|
2018-08-08 15:39:18 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|