File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
app/views/rails_admin/main Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 11- @model_config.show.with(object: @object, view: self, controller: self.controller).visible_groups.each do |fieldset|
22 - unless (fields = fieldset.with(object: @object, view: self, controller: self.controller).visible_fields).empty?
3- - unless (fields = fields.reject{ |f| RailsAdmin::config.compact_show_view && f.formatted_value.nil? || f.formatted_value == '' }).empty?
3+ - unless (fields = fields.reject{ |f| RailsAdmin::config.compact_show_view && ( f.formatted_value.nil? || f.formatted_value == '') }).empty?
44 .fieldset
55 %h4
66 = fieldset.label
Original file line number Diff line number Diff line change 7676 end
7777 end
7878
79+ context 'when compact_show_view is disabled' do
80+ before do
81+ RailsAdmin . config do |c |
82+ c . compact_show_view = false
83+ end
84+ end
85+
86+ it 'shows nil fields' do
87+ team . update logo_url : nil
88+ visit show_path ( model_name : 'team' , id : team . id )
89+ is_expected . to have_css ( '.logo_url_field' )
90+ end
91+
92+ it 'shows blank fields' do
93+ team . update logo_url : ''
94+ visit show_path ( model_name : 'team' , id : team . id )
95+ is_expected . to have_css ( '.logo_url_field' )
96+ end
97+ end
98+
7999 describe 'bindings' do
80100 it 'should be present' do
81101 RailsAdmin . config Team do |_c |
You can’t perform that action at this time.
0 commit comments