require 'spec_helper' describe DataTable do let(:collection) { [ {:name => 'Luke Skywalker', :class => 'Jedi Knight'}, {:name => 'Emporer Palpatine', :class => 'Sith Lord'}, {:name => 'Mithrander', :class => 'Wizard'}, {:name => 'Aragorn', :class => 'Ranger'} ] } it "should render the collection" do html = DataTable.render(collection) do |t| t.column :name, 'Name' t.column :class, 'Class' end expect(html).to eq(%{
NameClass
Luke SkywalkerJedi Knight
Emporer PalpatineSith Lord
MithranderWizard
AragornRanger
}) end end