[#1421] Extract values for both drop down lists
This commit is contained in:
parent
2214fc6b86
commit
7b1e8c2110
2 changed files with 47 additions and 0 deletions
18
spec/models/champs/linked_drop_down_list_champ_spec.rb
Normal file
18
spec/models/champs/linked_drop_down_list_champ_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Champs::LinkedDropDownListChamp do
|
||||
describe '#unpack_value' do
|
||||
let(:champ) { described_class.new(value: '["tata", "tutu"]') }
|
||||
|
||||
it { expect(champ.master_value).to eq('tata') }
|
||||
it { expect(champ.slave_value).to eq('tutu') }
|
||||
end
|
||||
|
||||
describe '#pack_value' do
|
||||
let(:champ) { described_class.new(master_value: 'tata', slave_value: 'tutu') }
|
||||
|
||||
before { champ.save }
|
||||
|
||||
it { expect(champ.value).to eq('["tata","tutu"]') }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue