demarches-normaliennes/spec/models/champs/checkbox_champ_spec.rb

22 lines
409 B
Ruby
Raw Normal View History

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' }
it { is_expected.to eq('oui') }
end
context 'when the value is off' do
let(:value) { 'off' }
it { is_expected.to eq('non') }
end
end
end