spec/lib/presenter_spec.rb in table_cloth-0.1.2 vs spec/lib/presenter_spec.rb in table_cloth-0.2.0
- old
+ new
@@ -27,13 +27,16 @@
it 'returns all values for a row' do
subject.row_values(dummy_model).should == [1, 'robert', 'robert@example.com']
end
it 'returns an edit link in the actions column' do
- dummy_table.action {|object, view| view.link_to 'Edit', '/model/1/edit' }
+ dummy_table.actions do
+ action {|object, view| link_to 'Edit', '/model/1/edit' }
+ end
presenter = TableCloth::Presenter.new(objects, dummy_table, view_context)
- column = Nokogiri::HTML(presenter.row_values(dummy_model).last)
+ actions_value = presenter.row_values(dummy_model).last
+ column = Nokogiri::HTML(actions_value)
column.at_xpath('//a')[:href].should == '/model/1/edit'
column.at_xpath('//a').text.should == 'Edit'
end
it 'generates the values for all of the rows' do
\ No newline at end of file