11require 'spec_helper'
22
3- describe Formbuilder ::EntryRenderer do
3+ describe Formbuilder ::Views :: EntryDl do
44
55 TEXT_FIELD_PARAMS = { label : "Text" , type : "Formbuilder::ResponseFieldText" , sort_order : 0 }
66
99
1010 it 'should display a label for blind fields' do
1111 form . response_fields . create TEXT_FIELD_PARAMS . merge ( blind : true )
12- Formbuilder ::EntryRenderer . new ( entry , form , show_blind : true ) . to_html . should match ( 'Blind' )
12+ Formbuilder ::Views :: EntryDl . new ( entry : entry , form : form , show_blind : true ) . to_html . should match ( 'Blind' )
1313 end
1414
1515 it 'should only display blind fields when instructed to' do
1616 form . response_fields . create TEXT_FIELD_PARAMS . merge ( blind : true )
17- Formbuilder ::EntryRenderer . new ( entry , form ) . to_html . should_not match ( 'Blind' )
17+ Formbuilder ::Views :: EntryDl . new ( entry : entry , form : form ) . to_html . should_not match ( 'Blind' )
1818 end
1919
2020 it 'should display a label for admin only fields' do
2121 form . response_fields . create TEXT_FIELD_PARAMS . merge ( admin_only : true )
22- Formbuilder ::EntryRenderer . new ( entry , form ) . to_html . should match ( 'Admin Only ' )
22+ Formbuilder ::Views :: EntryDl . new ( entry : entry , form : form ) . to_html . should match ( 'Admin only ' )
2323 end
2424
2525 it 'should display placeholder text if there is no response' do
2626 form . response_fields . create TEXT_FIELD_PARAMS
27- Formbuilder ::EntryRenderer . new ( entry , form ) . to_html . should match ( 'No response' )
27+ Formbuilder ::Views :: EntryDl . new ( entry : entry , form : form ) . to_html . should match ( 'No response' )
2828 end
2929
3030 it 'should display the response' do
3131 rf = form . response_fields . create TEXT_FIELD_PARAMS
3232 entry . save_response ( 'buzz' , rf )
3333 entry . save ( validate : false )
34- Formbuilder ::EntryRenderer . new ( entry , form ) . to_html . should match ( 'buzz' )
34+ Formbuilder ::Views :: EntryDl . new ( entry : entry , form : form ) . to_html . should match ( 'buzz' )
3535 end
3636
3737end
0 commit comments