Remove datatables if there is no data

This commit is contained in:
rahul 2017-08-28 21:55:31 +05:30
parent b7901e54d6
commit fbd11a1402
3 changed files with 113 additions and 112 deletions

View file

@ -29,6 +29,7 @@
( (
= link_to "#{@conference.booth_limit} booths", edit_admin_conference_path(@conference.short_title) = link_to "#{@conference.booth_limit} booths", edit_admin_conference_path(@conference.short_title)
) )
- if @booths.any?
%table.table.table-striped.table-bordered.table-hover.datatable %table.table.table-striped.table-bordered.table-hover.datatable
%thead %thead
%th %th

View file

@ -7,6 +7,7 @@
Categorize events in your conference Categorize events in your conference
.row .row
.col-md-12 .col-md-12
- if @tracks.any?
%table.table.table-hover.table-striped.table-bordered.datatable#tracks %table.table.table-hover.table-striped.table-bordered.datatable#tracks
%thead %thead
%th ID %th ID

View file

@ -42,11 +42,10 @@ feature Track do
expected.to change { Track.count }.by(-1) expected.to change { Track.count }.by(-1)
expect(flash).to eq('Track successfully deleted.') expect(flash).to eq('Track successfully deleted.')
within('table#tracks') do expect(page.has_css?('table#tracks')).to be false
expect(page.has_content?(track.name)).to be false expect(page.has_content?(track.name)).to be false
expect(page.has_content?(track.description)).to be false expect(page.has_content?(track.description)).to be false
end end
end
scenario 'updates a track', feature: true, js: true do scenario 'updates a track', feature: true, js: true do
create(:track, program_id: conference.program.id) create(:track, program_id: conference.program.id)