panels_for 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2b5a6275dc5062ad1b751054a1a9c51ae086187
4
- data.tar.gz: 5da8604f67d68f9267d024d0a491a7d643370404
3
+ metadata.gz: 06e2f5189e6aac988337170979c7a299cb8ab593
4
+ data.tar.gz: 63a523a62847ed1db1371b874dd8224e9e9a2a4b
5
5
  SHA512:
6
- metadata.gz: a98787296d1e28da3f0a032397e667dfd7db9e171feeebb55ae9cad15b349065fa814e14efcdad5f234bede0aa54fac926bb4890144f6b84ebc64dedb8648769
7
- data.tar.gz: 1f248d59de87c4783268d4f6452ab3e9afcac1440a8c24936bbc70bdc26d4fad006a1629d579464fcfdf275b4c5006cd662a48d3426a5ee9d5a947fde4d5cd81
6
+ metadata.gz: 2bde647e2ba64802ecc472c41f17e6a95efacf5d30897006fa8bab310abb867cc8b8165a366e007bb478d81f4233be00c215ccdacb397fca0331ea26e3de53f9
7
+ data.tar.gz: 46b0b43d67cafd5d391cd019bc34358a46141df10584a6d2c4ded70f3e7b7605bf0bb3602f64db3c2102f5cb4c210dfa7e4f3d79e7954e766af3ddddd6767fce
@@ -19,57 +19,58 @@ module PanelsFor
19
19
  @template = template
20
20
  end
21
21
 
22
- def panel(title, options = {}, &block)
23
- content = panel_default(title, options, &block)
24
- options[:collapse] ? panel_group(title, content) : content
22
+ def panel(name, options = {}, &block)
23
+ content = panel_default(name, options, &block)
24
+ options[:collapse] ? panel_group(name, content) : content
25
25
  end
26
26
 
27
27
  private
28
28
 
29
- def panel_default(title, options = {}, &block)
29
+ def panel_default(name, options = {}, &block)
30
30
  html_options = {}
31
31
  html_options[:id] = options.delete(:id) if options.key?(:id)
32
32
  html_options.reverse_merge!({ class: 'panel panel-default' })
33
33
 
34
34
  content_tag(:div, html_options) do
35
- concat(panel_heading(title, options))
36
- concat(panel_body(title, options, &block))
35
+ concat(panel_heading(name, options))
36
+ concat(panel_body(name, options, &block))
37
37
  end
38
38
  end
39
39
 
40
- def panel_group(title, content)
40
+ def panel_group(name, content)
41
41
  content_tag(
42
42
  :div,
43
43
  content,
44
44
  class:
45
45
  'panel-group',
46
- id: "#{title.to_s.underscore}_accordian",
46
+ id: "#{name.to_s.underscore}_accordian",
47
47
  role: 'tablist',
48
48
  aria: { multiselectable: 'true' }
49
49
  )
50
50
  end
51
51
 
52
- def panel_heading(title, options = {})
53
- content = prepare_content(title, options)
52
+ def panel_heading(name, options = {})
53
+ title = prepare_title(name, options)
54
54
  expanded = options[:expanded] ? 'true' : 'false'
55
55
 
56
56
  if options[:collapse]
57
57
  content = link_to(
58
- content, "##{collapse_id(title)}",
58
+ title,
59
+ "##{collapse_id(name)}",
59
60
  role: 'button',
60
61
  data: {
61
62
  toggle: 'collapse',
62
- parent: "##{title.to_s.underscore}_accordian"
63
+ parent: "##{name.to_s.underscore}_accordian"
63
64
  },
64
- aria: { expanded: expanded, controls: collapse_id(title) }
65
+ aria: { expanded: expanded, controls: collapse_id(name) }
65
66
  )
66
67
  content_tag(:div, panel_title(content),
67
68
  class: 'panel-heading',
68
69
  role: 'tab',
69
- id: heading_id(title))
70
+ id: heading_id(name))
70
71
  else
71
72
  content_tag(:div, class: 'panel-heading') do
72
- panel_title(content)
73
+ panel_title(title)
73
74
  end
74
75
  end
75
76
  end
@@ -103,9 +104,9 @@ module PanelsFor
103
104
  )
104
105
  end
105
106
 
106
- def prepare_content(title, options)
107
- content = title.to_s.titleize
108
- options[:icon] ? fa_icon(options[:icon], text: content) : content
107
+ def prepare_title(name, options)
108
+ title = options[:title] || name.to_s.titleize
109
+ options[:icon] ? fa_icon(options[:icon], text: title) : title
109
110
  end
110
111
 
111
112
  def heading_id(title)
@@ -1,3 +1,3 @@
1
1
  module PanelsFor
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -1798,5 +1798,593 @@ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_
1798
1798
   (0.0ms) begin transaction
1799
1799
  -------------------------
1800
1800
  PanelsForTest: test_truth
1801
+ -------------------------
1802
+  (0.0ms) rollback transaction
1803
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
1804
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1805
+  (1.4ms) select sqlite_version(*)
1806
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1807
+  (0.2ms) SELECT version FROM "schema_migrations"
1808
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1809
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1810
+  (0.1ms) begin transaction
1811
+ -------------------------
1812
+ PanelsForTest: test_truth
1813
+ -------------------------
1814
+  (0.1ms) rollback transaction
1815
+  (0.1ms) begin transaction
1816
+ ---------------------------------------------------------------------------------------------------------------------------
1817
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1818
+ ---------------------------------------------------------------------------------------------------------------------------
1819
+  (0.1ms) rollback transaction
1820
+  (0.1ms) begin transaction
1821
+ ---------------------------------------------------------------------------------------------------
1822
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1823
+ ---------------------------------------------------------------------------------------------------
1824
+  (0.1ms) rollback transaction
1825
+  (0.1ms) begin transaction
1826
+ ------------------------------------------------------------------------------------------------------
1827
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1828
+ ------------------------------------------------------------------------------------------------------
1829
+  (0.1ms) rollback transaction
1830
+  (0.0ms) begin transaction
1831
+ -------------------------------------------------------------------------------------------------
1832
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1833
+ -------------------------------------------------------------------------------------------------
1834
+  (0.1ms) rollback transaction
1835
+  (0.1ms) begin transaction
1836
+ -------------------------------------------------------------------------------------------------------
1837
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
1838
+ -------------------------------------------------------------------------------------------------------
1839
+  (0.0ms) rollback transaction
1840
+  (0.0ms) begin transaction
1841
+ -----------------------------------------------------------------------------
1842
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1843
+ -----------------------------------------------------------------------------
1844
+  (0.1ms) rollback transaction
1845
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1846
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1847
+  (0.1ms) select sqlite_version(*)
1848
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1849
+  (0.1ms) SELECT version FROM "schema_migrations"
1850
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1851
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1852
+  (0.2ms) begin transaction
1853
+ ---------------------------------------------------------------------------------------------------
1854
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1855
+ ---------------------------------------------------------------------------------------------------
1856
+  (0.1ms) rollback transaction
1857
+  (0.1ms) begin transaction
1858
+ -------------------------------------------------------------------------------------------------
1859
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1860
+ -------------------------------------------------------------------------------------------------
1861
+  (0.1ms) rollback transaction
1862
+  (0.1ms) begin transaction
1863
+ ------------------------------------------------------------------------------------------------------
1864
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1865
+ ------------------------------------------------------------------------------------------------------
1866
+  (0.1ms) rollback transaction
1867
+  (0.1ms) begin transaction
1868
+ -----------------------------------------------------------------------------
1869
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1870
+ -----------------------------------------------------------------------------
1871
+  (0.1ms) rollback transaction
1872
+  (0.1ms) begin transaction
1873
+ -------------------------------------------------------------------------------------------------------
1874
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
1875
+ -------------------------------------------------------------------------------------------------------
1876
+  (0.1ms) rollback transaction
1877
+  (0.1ms) begin transaction
1878
+ ---------------------------------------------------------------------------------------------------------------------------
1879
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1880
+ ---------------------------------------------------------------------------------------------------------------------------
1881
+  (0.1ms) rollback transaction
1882
+  (0.1ms) begin transaction
1883
+ -------------------------
1884
+ PanelsForTest: test_truth
1885
+ -------------------------
1886
+  (1.1ms) rollback transaction
1887
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1888
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1889
+  (0.1ms) select sqlite_version(*)
1890
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1891
+  (0.2ms) SELECT version FROM "schema_migrations"
1892
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1893
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1894
+  (0.1ms) begin transaction
1895
+ -------------------------
1896
+ PanelsForTest: test_truth
1897
+ -------------------------
1898
+  (0.2ms) rollback transaction
1899
+  (0.1ms) begin transaction
1900
+ -----------------------------------------------------------------------------
1901
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1902
+ -----------------------------------------------------------------------------
1903
+  (0.1ms) rollback transaction
1904
+  (0.1ms) begin transaction
1905
+ ------------------------------------------------------------------------------------------------------
1906
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1907
+ ------------------------------------------------------------------------------------------------------
1908
+  (0.1ms) rollback transaction
1909
+  (0.1ms) begin transaction
1910
+ -------------------------------------------------------------------------------------------------------
1911
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
1912
+ -------------------------------------------------------------------------------------------------------
1913
+  (0.1ms) rollback transaction
1914
+  (0.1ms) begin transaction
1915
+ ---------------------------------------------------------------------------------------------------------------------------
1916
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1917
+ ---------------------------------------------------------------------------------------------------------------------------
1918
+  (0.1ms) rollback transaction
1919
+  (0.1ms) begin transaction
1920
+ -------------------------------------------------------------------------------------------------
1921
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1922
+ -------------------------------------------------------------------------------------------------
1923
+  (0.1ms) rollback transaction
1924
+  (0.1ms) begin transaction
1925
+ ---------------------------------------------------------------------------------------------------
1926
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1927
+ ---------------------------------------------------------------------------------------------------
1928
+  (0.1ms) rollback transaction
1929
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1930
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1931
+  (0.1ms) select sqlite_version(*)
1932
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1933
+  (0.1ms) SELECT version FROM "schema_migrations"
1934
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1935
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1936
+  (0.1ms) begin transaction
1937
+ ------------------------------------------------------------------------------------------------------
1938
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1939
+ ------------------------------------------------------------------------------------------------------
1940
+  (0.1ms) rollback transaction
1941
+  (0.1ms) begin transaction
1942
+ ---------------------------------------------------------------------------------------------------
1943
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1944
+ ---------------------------------------------------------------------------------------------------
1945
+  (0.1ms) rollback transaction
1946
+  (0.0ms) begin transaction
1947
+ -------------------------------------------------------------------------------------------------
1948
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1949
+ -------------------------------------------------------------------------------------------------
1950
+  (0.1ms) rollback transaction
1951
+  (0.1ms) begin transaction
1952
+ -------------------------------------------------------------------------------------------------------
1953
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
1954
+ -------------------------------------------------------------------------------------------------------
1955
+  (0.1ms) rollback transaction
1956
+  (0.1ms) begin transaction
1957
+ -----------------------------------------------------------------------------
1958
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1959
+ -----------------------------------------------------------------------------
1960
+  (0.1ms) rollback transaction
1961
+  (0.1ms) begin transaction
1962
+ ---------------------------------------------------------------------------------------------------------------------------
1963
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1964
+ ---------------------------------------------------------------------------------------------------------------------------
1965
+  (0.1ms) rollback transaction
1966
+  (0.1ms) begin transaction
1967
+ -------------------------
1968
+ PanelsForTest: test_truth
1969
+ -------------------------
1970
+  (0.0ms) rollback transaction
1971
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1972
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1973
+  (0.1ms) select sqlite_version(*)
1974
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1975
+  (0.1ms) SELECT version FROM "schema_migrations"
1976
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1977
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1978
+  (0.1ms) begin transaction
1979
+ -------------------------------------------------------------------------------------------------------
1980
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
1981
+ -------------------------------------------------------------------------------------------------------
1982
+  (0.1ms) rollback transaction
1983
+  (0.0ms) begin transaction
1984
+ ---------------------------------------------------------------------------------------------------------------------------
1985
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1986
+ ---------------------------------------------------------------------------------------------------------------------------
1987
+  (0.1ms) rollback transaction
1988
+  (0.1ms) begin transaction
1989
+ -------------------------------------------------------------------------------------------------
1990
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1991
+ -------------------------------------------------------------------------------------------------
1992
+  (0.1ms) rollback transaction
1993
+  (0.1ms) begin transaction
1994
+ ------------------------------------------------------------------------------------------------------
1995
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1996
+ ------------------------------------------------------------------------------------------------------
1997
+  (0.1ms) rollback transaction
1998
+  (0.1ms) begin transaction
1999
+ ---------------------------------------------------------------------------------------------------
2000
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2001
+ ---------------------------------------------------------------------------------------------------
2002
+  (0.1ms) rollback transaction
2003
+  (0.1ms) begin transaction
2004
+ -----------------------------------------------------------------------------
2005
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2006
+ -----------------------------------------------------------------------------
2007
+  (0.1ms) rollback transaction
2008
+  (0.1ms) begin transaction
2009
+ -------------------------
2010
+ PanelsForTest: test_truth
2011
+ -------------------------
2012
+  (0.0ms) rollback transaction
2013
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2014
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2015
+  (0.1ms) select sqlite_version(*)
2016
+  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2017
+  (0.2ms) SELECT version FROM "schema_migrations"
2018
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2019
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2020
+  (0.1ms) begin transaction
2021
+ -------------------------
2022
+ PanelsForTest: test_truth
2023
+ -------------------------
2024
+  (0.1ms) rollback transaction
2025
+  (0.1ms) begin transaction
2026
+ ------------------------------------------------------------------------------------------------------
2027
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2028
+ ------------------------------------------------------------------------------------------------------
2029
+  (0.1ms) rollback transaction
2030
+  (0.0ms) begin transaction
2031
+ ---------------------------------------------------------------------------------------------------------------------------
2032
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2033
+ ---------------------------------------------------------------------------------------------------------------------------
2034
+  (0.1ms) rollback transaction
2035
+  (0.1ms) begin transaction
2036
+ -------------------------------------------------------------------------------------------------
2037
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2038
+ -------------------------------------------------------------------------------------------------
2039
+  (0.1ms) rollback transaction
2040
+  (0.0ms) begin transaction
2041
+ -----------------------------------------------------------------------------
2042
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2043
+ -----------------------------------------------------------------------------
2044
+  (0.1ms) rollback transaction
2045
+  (0.0ms) begin transaction
2046
+ -------------------------------------------------------------------------------------------------------
2047
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2048
+ -------------------------------------------------------------------------------------------------------
2049
+  (0.1ms) rollback transaction
2050
+  (0.1ms) begin transaction
2051
+ ---------------------------------------------------------------------------------------------------
2052
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2053
+ ---------------------------------------------------------------------------------------------------
2054
+  (0.1ms) rollback transaction
2055
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2056
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2057
+  (0.1ms) select sqlite_version(*)
2058
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2059
+  (0.1ms) SELECT version FROM "schema_migrations"
2060
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2061
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
2062
+  (0.1ms) begin transaction
2063
+ -------------------------
2064
+ PanelsForTest: test_truth
2065
+ -------------------------
2066
+  (0.1ms) rollback transaction
2067
+  (0.1ms) begin transaction
2068
+ ---------------------------------------------------------------------------------------------------
2069
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2070
+ ---------------------------------------------------------------------------------------------------
2071
+  (0.1ms) rollback transaction
2072
+  (0.1ms) begin transaction
2073
+ -----------------------------------------------------------------------------
2074
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2075
+ -----------------------------------------------------------------------------
2076
+  (0.1ms) rollback transaction
2077
+  (0.0ms) begin transaction
2078
+ -------------------------------------------------------------------------------------------------
2079
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2080
+ -------------------------------------------------------------------------------------------------
2081
+  (0.3ms) rollback transaction
2082
+  (0.3ms) begin transaction
2083
+ ------------------------------------------------------------------------------------------------------
2084
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2085
+ ------------------------------------------------------------------------------------------------------
2086
+  (0.1ms) rollback transaction
2087
+  (0.1ms) begin transaction
2088
+ ---------------------------------------------------------------------------------------------------------------------------
2089
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2090
+ ---------------------------------------------------------------------------------------------------------------------------
2091
+  (0.1ms) rollback transaction
2092
+  (0.1ms) begin transaction
2093
+ -------------------------------------------------------------------------------------------------------
2094
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2095
+ -------------------------------------------------------------------------------------------------------
2096
+  (0.1ms) rollback transaction
2097
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
2098
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2099
+  (0.4ms) select sqlite_version(*)
2100
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2101
+  (0.1ms) SELECT version FROM "schema_migrations"
2102
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2103
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2104
+  (0.1ms) begin transaction
2105
+ -------------------------
2106
+ PanelsForTest: test_truth
2107
+ -------------------------
2108
+  (0.1ms) rollback transaction
2109
+  (0.1ms) begin transaction
2110
+ -----------------------------------------------------------------------------
2111
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2112
+ -----------------------------------------------------------------------------
2113
+  (0.1ms) rollback transaction
2114
+  (0.1ms) begin transaction
2115
+ -------------------------------------------------------------------------------------------------------
2116
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2117
+ -------------------------------------------------------------------------------------------------------
2118
+  (0.1ms) rollback transaction
2119
+  (0.1ms) begin transaction
2120
+ ------------------------------------------------------------------------------------------------------
2121
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2122
+ ------------------------------------------------------------------------------------------------------
2123
+  (0.1ms) rollback transaction
2124
+  (0.0ms) begin transaction
2125
+ ---------------------------------------------------------------------------------------------------------------------------
2126
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2127
+ ---------------------------------------------------------------------------------------------------------------------------
2128
+  (0.1ms) rollback transaction
2129
+  (0.1ms) begin transaction
2130
+ -------------------------------------------------------------------------------------------------
2131
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2132
+ -------------------------------------------------------------------------------------------------
2133
+  (0.1ms) rollback transaction
2134
+  (0.1ms) begin transaction
2135
+ ---------------------------------------------------------------------------------------------------
2136
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2137
+ ---------------------------------------------------------------------------------------------------
2138
+  (0.1ms) rollback transaction
2139
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2140
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2141
+  (0.1ms) select sqlite_version(*)
2142
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2143
+  (0.1ms) SELECT version FROM "schema_migrations"
2144
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2145
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2146
+  (0.1ms) begin transaction
2147
+ -------------------------
2148
+ PanelsForTest: test_truth
2149
+ -------------------------
2150
+  (0.1ms) rollback transaction
2151
+  (0.1ms) begin transaction
2152
+ -------------------------------------------------------------------------------------------------------
2153
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2154
+ -------------------------------------------------------------------------------------------------------
2155
+  (0.1ms) rollback transaction
2156
+  (0.1ms) begin transaction
2157
+ ---------------------------------------------------------------------------------------------------
2158
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2159
+ ---------------------------------------------------------------------------------------------------
2160
+  (0.1ms) rollback transaction
2161
+  (0.0ms) begin transaction
2162
+ ------------------------------------------------------------------------------------------------------
2163
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2164
+ ------------------------------------------------------------------------------------------------------
2165
+  (0.1ms) rollback transaction
2166
+  (0.0ms) begin transaction
2167
+ ---------------------------------------------------------------------------------------------------------------------------
2168
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2169
+ ---------------------------------------------------------------------------------------------------------------------------
2170
+  (0.1ms) rollback transaction
2171
+  (0.0ms) begin transaction
2172
+ -----------------------------------------------------------------------------
2173
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2174
+ -----------------------------------------------------------------------------
2175
+  (0.1ms) rollback transaction
2176
+  (0.1ms) begin transaction
2177
+ -------------------------------------------------------------------------------------------------
2178
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2179
+ -------------------------------------------------------------------------------------------------
2180
+  (0.1ms) rollback transaction
2181
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2182
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2183
+  (0.1ms) select sqlite_version(*)
2184
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2185
+  (0.1ms) SELECT version FROM "schema_migrations"
2186
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2187
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2188
+  (0.2ms) begin transaction
2189
+ -------------------------
2190
+ PanelsForTest: test_truth
2191
+ -------------------------
2192
+  (0.1ms) rollback transaction
2193
+  (0.1ms) begin transaction
2194
+ -----------------------------------------------------------------------------
2195
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2196
+ -----------------------------------------------------------------------------
2197
+  (0.1ms) rollback transaction
2198
+  (0.1ms) begin transaction
2199
+ -------------------------------------------------------------------------------------------------
2200
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2201
+ -------------------------------------------------------------------------------------------------
2202
+  (0.2ms) rollback transaction
2203
+  (0.2ms) begin transaction
2204
+ ------------------------------------------------------------------------------------------------------
2205
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2206
+ ------------------------------------------------------------------------------------------------------
2207
+  (0.1ms) rollback transaction
2208
+  (0.2ms) begin transaction
2209
+ ---------------------------------------------------------------------------------------------------
2210
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2211
+ ---------------------------------------------------------------------------------------------------
2212
+  (0.1ms) rollback transaction
2213
+  (0.1ms) begin transaction
2214
+ ---------------------------------------------------------------------------------------------------------------------------
2215
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2216
+ ---------------------------------------------------------------------------------------------------------------------------
2217
+  (0.2ms) rollback transaction
2218
+  (0.1ms) begin transaction
2219
+ -------------------------------------------------------------------------------------------------------
2220
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2221
+ -------------------------------------------------------------------------------------------------------
2222
+  (0.1ms) rollback transaction
2223
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2224
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2225
+  (0.1ms) select sqlite_version(*)
2226
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2227
+  (0.1ms) SELECT version FROM "schema_migrations"
2228
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2229
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2230
+  (0.1ms) begin transaction
2231
+ -------------------------
2232
+ PanelsForTest: test_truth
2233
+ -------------------------
2234
+  (0.1ms) rollback transaction
2235
+  (0.1ms) begin transaction
2236
+ -------------------------------------------------------------------------------------------------------
2237
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2238
+ -------------------------------------------------------------------------------------------------------
2239
+  (0.1ms) rollback transaction
2240
+  (0.1ms) begin transaction
2241
+ -------------------------------------------------------------------------------------------------
2242
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2243
+ -------------------------------------------------------------------------------------------------
2244
+  (0.1ms) rollback transaction
2245
+  (0.1ms) begin transaction
2246
+ ------------------------------------------------------------------------------------------------------
2247
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2248
+ ------------------------------------------------------------------------------------------------------
2249
+  (0.1ms) rollback transaction
2250
+  (0.1ms) begin transaction
2251
+ ---------------------------------------------------------------------------------------------------
2252
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2253
+ ---------------------------------------------------------------------------------------------------
2254
+  (0.1ms) rollback transaction
2255
+  (0.1ms) begin transaction
2256
+ ---------------------------------------------------------------------------------------------------------------------------
2257
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2258
+ ---------------------------------------------------------------------------------------------------------------------------
2259
+  (0.1ms) rollback transaction
2260
+  (0.1ms) begin transaction
2261
+ -----------------------------------------------------------------------------
2262
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2263
+ -----------------------------------------------------------------------------
2264
+  (0.1ms) rollback transaction
2265
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2266
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2267
+  (0.2ms) select sqlite_version(*)
2268
+  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2269
+  (0.2ms) SELECT version FROM "schema_migrations"
2270
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2271
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2272
+  (0.2ms) begin transaction
2273
+ ------------------------------------------------------------------------------------------------------
2274
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2275
+ ------------------------------------------------------------------------------------------------------
2276
+  (0.1ms) rollback transaction
2277
+  (0.1ms) begin transaction
2278
+ ---------------------------------------------------------------------------------------------------
2279
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2280
+ ---------------------------------------------------------------------------------------------------
2281
+  (0.1ms) rollback transaction
2282
+  (0.1ms) begin transaction
2283
+ -------------------------------------------------------------------------------------------------
2284
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2285
+ -------------------------------------------------------------------------------------------------
2286
+  (0.1ms) rollback transaction
2287
+  (0.1ms) begin transaction
2288
+ -----------------------------------------------------------------------------
2289
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2290
+ -----------------------------------------------------------------------------
2291
+  (0.1ms) rollback transaction
2292
+  (0.1ms) begin transaction
2293
+ -------------------------------------------------------------------------------------------------------
2294
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2295
+ -------------------------------------------------------------------------------------------------------
2296
+  (0.1ms) rollback transaction
2297
+  (0.1ms) begin transaction
2298
+ ---------------------------------------------------------------------------------------------------------------------------
2299
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2300
+ ---------------------------------------------------------------------------------------------------------------------------
2301
+  (0.1ms) rollback transaction
2302
+  (0.1ms) begin transaction
2303
+ -------------------------
2304
+ PanelsForTest: test_truth
2305
+ -------------------------
2306
+  (0.0ms) rollback transaction
2307
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2308
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2309
+  (0.1ms) select sqlite_version(*)
2310
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2311
+  (0.2ms) SELECT version FROM "schema_migrations"
2312
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2313
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2314
+  (0.1ms) begin transaction
2315
+ ------------------------------------------------------------------------------------------------------
2316
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2317
+ ------------------------------------------------------------------------------------------------------
2318
+  (0.1ms) rollback transaction
2319
+  (0.0ms) begin transaction
2320
+ -------------------------------------------------------------------------------------------------------
2321
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2322
+ -------------------------------------------------------------------------------------------------------
2323
+  (0.1ms) rollback transaction
2324
+  (0.0ms) begin transaction
2325
+ -----------------------------------------------------------------------------
2326
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2327
+ -----------------------------------------------------------------------------
2328
+  (0.1ms) rollback transaction
2329
+  (0.1ms) begin transaction
2330
+ -------------------------------------------------------------------------------------------------
2331
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2332
+ -------------------------------------------------------------------------------------------------
2333
+  (0.1ms) rollback transaction
2334
+  (0.0ms) begin transaction
2335
+ ---------------------------------------------------------------------------------------------------------------------------
2336
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2337
+ ---------------------------------------------------------------------------------------------------------------------------
2338
+  (0.1ms) rollback transaction
2339
+  (0.1ms) begin transaction
2340
+ ---------------------------------------------------------------------------------------------------
2341
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2342
+ ---------------------------------------------------------------------------------------------------
2343
+  (0.1ms) rollback transaction
2344
+  (0.1ms) begin transaction
2345
+ -------------------------
2346
+ PanelsForTest: test_truth
2347
+ -------------------------
2348
+  (0.1ms) rollback transaction
2349
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
2350
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2351
+  (0.1ms) select sqlite_version(*)
2352
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2353
+  (0.1ms) SELECT version FROM "schema_migrations"
2354
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
2355
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2356
+  (0.1ms) begin transaction
2357
+ -------------------------------------------------------------------------------------------------------
2358
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:title]_creates_a_panel_with_title_in_header
2359
+ -------------------------------------------------------------------------------------------------------
2360
+  (0.1ms) rollback transaction
2361
+  (0.1ms) begin transaction
2362
+ ---------------------------------------------------------------------------------------------------------------------------
2363
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
2364
+ ---------------------------------------------------------------------------------------------------------------------------
2365
+  (0.1ms) rollback transaction
2366
+  (0.1ms) begin transaction
2367
+ ---------------------------------------------------------------------------------------------------
2368
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
2369
+ ---------------------------------------------------------------------------------------------------
2370
+  (0.1ms) rollback transaction
2371
+  (0.0ms) begin transaction
2372
+ -------------------------------------------------------------------------------------------------
2373
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
2374
+ -------------------------------------------------------------------------------------------------
2375
+  (0.1ms) rollback transaction
2376
+  (0.0ms) begin transaction
2377
+ -----------------------------------------------------------------------------
2378
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
2379
+ -----------------------------------------------------------------------------
2380
+  (0.1ms) rollback transaction
2381
+  (0.1ms) begin transaction
2382
+ ------------------------------------------------------------------------------------------------------
2383
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
2384
+ ------------------------------------------------------------------------------------------------------
2385
+  (0.1ms) rollback transaction
2386
+  (0.1ms) begin transaction
2387
+ -------------------------
2388
+ PanelsForTest: test_truth
1801
2389
  -------------------------
1802
2390
   (0.0ms) rollback transaction
@@ -37,6 +37,13 @@ class PanelsFor::Rails::PanelsForHelperTest < ActionView::TestCase
37
37
  end
38
38
  end
39
39
 
40
+ test "#panel options[:title] creates a panel with title in header" do
41
+ expected = '<div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title">Hello</h4></div><div class="panel-body">Content</div></div>'
42
+ assert_panel_for(expected, object) do |b|
43
+ b.panel(:graphs, title: 'Hello') { 'Content' }
44
+ end
45
+ end
46
+
40
47
  private
41
48
 
42
49
  def object
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panels_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ole J. Rosendahl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails