Sha256: 8f2c6baecbb0a5f1495d796735ea5f44f37f3e682840f627a1498ad43886dc9d

Contents?: true

Size: 1017 Bytes

Versions: 5

Compression:

Stored size: 1017 Bytes

Contents

require 'spec_helper'
require "will_paginate"
require "active_support/core_ext/hash"
require "active_support/core_ext/object"

describe Datagrid::Helper do
  subject {ActionView::Base.new}

  before(:each) do
    subject.stub!(:params).and_return({})
    subject.stub(:url_for) do |options|
      options.to_param
    end
    
  end

  let(:group) { Group.create!(:name => "Pop") }
  let!(:entry) {  Entry.create!(
    :group => group, :name => "Star", :disabled => false, :confirmed => false, :category => "first"
  ) }
  let(:grid) { SimpleReport.new }

  describe ".report_table" do
    before(:each) do
      subject.stub!(:datagrid_order_for).and_return(subject.content_tag(:div, "", :class => "order"))
    end
    it "should return data table html" do
      subject.datagrid_table(grid).should equal_to_dom(
'<table class="datagrid">
<tr>
<th>Group<div class="order"></div>
</th>
<th>Name<div class="order"></div>
</th>
</tr>

<tr class="odd">
<td>Pop</td>
<td>Star</td>
</tr>
</table>')
    end
  end
  

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
datagrid-0.2.0 spec/datagrid/helper_spec.rb
datagrid-0.1.2 spec/datagrid/helper_spec.rb
datagrid-0.1.1 spec/datagrid/helper_spec.rb
datagrid-0.1.0 spec/datagrid/helper_spec.rb
datagrid-0.0.3 spec/datagrid/helper_spec.rb