paginated_table 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,6 +36,12 @@ describe "paginated_table integration" do
36
36
  end
37
37
  end
38
38
 
39
+ it "applies the 'centered' css class to the data in the first column" do
40
+ (1..10).each do |row|
41
+ page.has_xpath?("#{tr_xpath(row)}/td[1][@class='centered']").must_equal true
42
+ end
43
+ end
44
+
39
45
  describe "with javascript" do
40
46
  before do
41
47
  Capybara.current_driver = Capybara.javascript_driver
@@ -74,6 +74,22 @@ module PaginatedTable
74
74
  end
75
75
  end
76
76
 
77
+ describe "#html_attributes" do
78
+ it "returns an empty hash by default" do
79
+ TableDescription::Column.new(:foo).html_attributes.must_equal({})
80
+ end
81
+
82
+ it "adds the css classes given by the :class option" do
83
+ TableDescription::Column.new(:foo, :class => %w(bar baz)).
84
+ html_attributes.must_equal({ :class => 'bar baz' })
85
+ end
86
+
87
+ it "adds the css styles given by the :style option" do
88
+ TableDescription::Column.new(:foo, :style => 'font-face: bold').
89
+ html_attributes.must_equal({ :style => 'font-face: bold' })
90
+ end
91
+ end
92
+
77
93
  describe "#render_header" do
78
94
  it "returns the titleized name" do
79
95
  TableDescription::Column.new(:foo).render_header.must_equal "Foo"
@@ -310,7 +326,9 @@ module PaginatedTable
310
326
  datum = stub("datum")
311
327
  column = stub("column")
312
328
  column.stubs(:render_cell).with(datum).returns("<datum/>")
313
- view.expects(:content_tag).with('td', "<datum/>")
329
+ attributes = stub("attributes")
330
+ column.stubs(:html_attributes).with().returns(attributes)
331
+ view.expects(:content_tag).with('td', "<datum/>", attributes)
314
332
  table.render_table_body_cell(datum, column)
315
333
  end
316
334
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paginated_table
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Donald Ball