twitter_bootstrap_markup 0.0.3 → 0.0.4
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.
- data/.gitignore +4 -4
- data/Gemfile +4 -4
- data/README.md +28 -28
- data/Rakefile +1 -1
- data/lib/twitter_bootstrap_markup.rb +52 -52
- data/lib/twitter_bootstrap_markup/add_on.rb +8 -8
- data/lib/twitter_bootstrap_markup/alert.rb +35 -35
- data/lib/twitter_bootstrap_markup/badge.rb +4 -4
- data/lib/twitter_bootstrap_markup/brand.rb +8 -8
- data/lib/twitter_bootstrap_markup/breadcrumb.rb +21 -21
- data/lib/twitter_bootstrap_markup/button.rb +16 -16
- data/lib/twitter_bootstrap_markup/button_base.rb +44 -44
- data/lib/twitter_bootstrap_markup/control_group.rb +25 -25
- data/lib/twitter_bootstrap_markup/divider.rb +29 -29
- data/lib/twitter_bootstrap_markup/dropdown_button.rb +58 -58
- data/lib/twitter_bootstrap_markup/dropdown_link.rb +29 -29
- data/lib/twitter_bootstrap_markup/extended_input.rb +10 -10
- data/lib/twitter_bootstrap_markup/extension/hash.rb +10 -10
- data/lib/twitter_bootstrap_markup/fieldset.rb +17 -17
- data/lib/twitter_bootstrap_markup/form.rb +26 -26
- data/lib/twitter_bootstrap_markup/grid_column.rb +13 -13
- data/lib/twitter_bootstrap_markup/grid_row.rb +8 -8
- data/lib/twitter_bootstrap_markup/help.rb +23 -23
- data/lib/twitter_bootstrap_markup/icon.rb +17 -17
- data/lib/twitter_bootstrap_markup/input.rb +24 -24
- data/lib/twitter_bootstrap_markup/input_size.rb +21 -21
- data/lib/twitter_bootstrap_markup/label.rb +4 -4
- data/lib/twitter_bootstrap_markup/label_base.rb +32 -32
- data/lib/twitter_bootstrap_markup/link.rb +16 -16
- data/lib/twitter_bootstrap_markup/link_button.rb +17 -17
- data/lib/twitter_bootstrap_markup/nav_bar.rb +33 -33
- data/lib/twitter_bootstrap_markup/nav_container.rb +9 -9
- data/lib/twitter_bootstrap_markup/nav_header.rb +8 -8
- data/lib/twitter_bootstrap_markup/nav_list.rb +15 -15
- data/lib/twitter_bootstrap_markup/nav_list_container.rb +9 -9
- data/lib/twitter_bootstrap_markup/nav_tab.rb +9 -9
- data/lib/twitter_bootstrap_markup/nav_tab_container.rb +12 -12
- data/lib/twitter_bootstrap_markup/page_header.rb +16 -16
- data/lib/twitter_bootstrap_markup/pagination.rb +28 -28
- data/lib/twitter_bootstrap_markup/popover.rb +19 -19
- data/lib/twitter_bootstrap_markup/progress_bar.rb +42 -42
- data/lib/twitter_bootstrap_markup/select.rb +54 -54
- data/lib/twitter_bootstrap_markup/side_position.rb +14 -14
- data/lib/twitter_bootstrap_markup/submit.rb +9 -9
- data/lib/twitter_bootstrap_markup/tab.rb +13 -13
- data/lib/twitter_bootstrap_markup/tab_content.rb +28 -28
- data/lib/twitter_bootstrap_markup/table.rb +28 -28
- data/lib/twitter_bootstrap_markup/tag.rb +62 -62
- data/lib/twitter_bootstrap_markup/tag_builder.rb +21 -21
- data/lib/twitter_bootstrap_markup/textarea.rb +14 -14
- data/lib/twitter_bootstrap_markup/tooltip.rb +18 -18
- data/lib/twitter_bootstrap_markup/ul_container.rb +27 -27
- data/lib/twitter_bootstrap_markup/version.rb +3 -3
- data/lib/twitter_bootstrap_markup/well.rb +27 -27
- data/markup/alerts.html +74 -74
- data/markup/badges.html +64 -64
- data/markup/breadcrumbs.html +58 -58
- data/markup/buttons.html +94 -94
- data/markup/control_groups.html +76 -76
- data/markup/css/bootstrap-responsive.css +815 -815
- data/markup/css/bootstrap-responsive.min.css +9 -9
- data/markup/css/bootstrap.css +4914 -4914
- data/markup/css/bootstrap.min.css +727 -727
- data/markup/dropdown_buttons.html +247 -247
- data/markup/dropdown_links.html +111 -111
- data/markup/form_fields.html +87 -87
- data/markup/forms.html +80 -80
- data/markup/grid_system.html +86 -86
- data/markup/index.html +38 -38
- data/markup/js/bootstrap.js +1835 -1835
- data/markup/js/bootstrap.min.js +6 -6
- data/markup/js/jquery-1.7.2.js +9402 -9402
- data/markup/labels.html +64 -64
- data/markup/link_buttons.html +94 -94
- data/markup/nav_bars.html +103 -103
- data/markup/nav_lists.html +53 -53
- data/markup/paginations.html +67 -67
- data/markup/popovers.html +55 -55
- data/markup/progress_bars.html +92 -92
- data/markup/selects.html +123 -123
- data/markup/tabs.html +45 -45
- data/markup/textareas.html +89 -89
- data/markup/textboxes.html +94 -94
- data/markup/tooltips.html +55 -55
- data/spec/add_on_spec.rb +9 -9
- data/spec/alert_spec.rb +77 -77
- data/spec/badge_spec.rb +40 -28
- data/spec/brand_spec.rb +9 -9
- data/spec/breadcrumb_spec.rb +32 -32
- data/spec/button_spec.rb +51 -51
- data/spec/control_group_spec.rb +28 -28
- data/spec/divider_spec.rb +16 -16
- data/spec/dropdown_button_spec.rb +100 -100
- data/spec/dropdown_link_spec.rb +47 -47
- data/spec/fieldset_spec.rb +21 -21
- data/spec/form_fields_spec.rb +70 -70
- data/spec/form_spec.rb +34 -34
- data/spec/grid_system_spec.rb +68 -68
- data/spec/help_spec.rb +12 -12
- data/spec/icon_spec.rb +17 -17
- data/spec/input_spec.rb +10 -10
- data/spec/label_spec.rb +40 -28
- data/spec/link_button_spec.rb +51 -51
- data/spec/link_spec.rb +28 -28
- data/spec/nav_bar_spec.rb +37 -37
- data/spec/nav_list_spec.rb +39 -39
- data/spec/page_header_spec.rb +12 -12
- data/spec/pagination_spec.rb +17 -17
- data/spec/popover_spec.rb +14 -14
- data/spec/progress_bar_spec.rb +52 -52
- data/spec/select_spec.rb +59 -59
- data/spec/spec_helper.rb +11 -11
- data/spec/support/helpers/html_helper.rb +10 -10
- data/spec/table_spec.rb +32 -32
- data/spec/tabs_spec.rb +21 -21
- data/spec/tag_builder_spec.rb +37 -37
- data/spec/tag_spec.rb +51 -51
- data/spec/text_area_spec.rb +42 -42
- data/spec/textbox_spec.rb +59 -59
- data/spec/tooltip_spec.rb +14 -14
- data/spec/well_spec.rb +16 -16
- data/twitter_bootstrap_markup.gemspec +25 -25
- metadata +25 -9
data/spec/tag_builder_spec.rb
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe TagBuilder do
|
|
4
|
-
|
|
5
|
-
it 'tag' do
|
|
6
|
-
TagBuilder.tag(:input, :type => 'button').to_s.should eq Tag.inline(:input, :type => 'button').to_s
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it 'inline' do
|
|
10
|
-
TagBuilder.tag_inline(:input, :type => 'button').to_s.should eq Tag.inline(:input, :type => 'button').to_s
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'block' do
|
|
14
|
-
TagBuilder.tag_block(:div, 'content').to_s.should eq Tag.block(:div, 'content').to_s
|
|
15
|
-
TagBuilder.tag_block(:div) { append 'content' }.to_s.should eq Tag.block(:div) { append 'content' }.to_s
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'link' do
|
|
19
|
-
TagBuilder.link('Title', 'url').to_s.should eq Link.new('Title', 'url').to_s
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'input_text' do
|
|
23
|
-
TagBuilder.input_text(:value => 'text').to_s.should eq Input.text(:value => 'text').to_s
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'input text small' do
|
|
27
|
-
TagBuilder.input_text_small(:value => 'text').to_s.should eq Input.text_small(:value => 'text').to_s
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'button primary mini' do
|
|
31
|
-
TagBuilder.button_primary_mini('Click').to_s.should eq Button.primary_mini('Click').to_s
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it 'submit primary' do
|
|
35
|
-
TagBuilder.submit_primary('Click').to_s.should eq Submit.primary('Click').to_s
|
|
36
|
-
end
|
|
37
|
-
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe TagBuilder do
|
|
4
|
+
|
|
5
|
+
it 'tag' do
|
|
6
|
+
TagBuilder.tag(:input, :type => 'button').to_s.should eq Tag.inline(:input, :type => 'button').to_s
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it 'inline' do
|
|
10
|
+
TagBuilder.tag_inline(:input, :type => 'button').to_s.should eq Tag.inline(:input, :type => 'button').to_s
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it 'block' do
|
|
14
|
+
TagBuilder.tag_block(:div, 'content').to_s.should eq Tag.block(:div, 'content').to_s
|
|
15
|
+
TagBuilder.tag_block(:div) { append 'content' }.to_s.should eq Tag.block(:div) { append 'content' }.to_s
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'link' do
|
|
19
|
+
TagBuilder.link('Title', 'url').to_s.should eq Link.new('Title', 'url').to_s
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'input_text' do
|
|
23
|
+
TagBuilder.input_text(:value => 'text').to_s.should eq Input.text(:value => 'text').to_s
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'input text small' do
|
|
27
|
+
TagBuilder.input_text_small(:value => 'text').to_s.should eq Input.text_small(:value => 'text').to_s
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'button primary mini' do
|
|
31
|
+
TagBuilder.button_primary_mini('Click').to_s.should eq Button.primary_mini('Click').to_s
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'submit primary' do
|
|
35
|
+
TagBuilder.submit_primary('Click').to_s.should eq Submit.primary('Click').to_s
|
|
36
|
+
end
|
|
37
|
+
|
|
38
38
|
end
|
data/spec/tag_spec.rb
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Tag do
|
|
4
|
-
|
|
5
|
-
it 'Create simple tag' do
|
|
6
|
-
Tag.inline(:input, :type => 'text', :id => 'text_field').to_s.should eq '<input type="text" id="text_field">'
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it 'Create simple tag in steps' do
|
|
10
|
-
tag = Tag.inline(:input)
|
|
11
|
-
tag.attributes[:type] = 'button'
|
|
12
|
-
tag.attributes[:value] = 'Click me'
|
|
13
|
-
|
|
14
|
-
tag.to_s.should eq '<input type="button" value="Click me">'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'Create block tag' do
|
|
18
|
-
Tag.block(:textarea, :id => 'long_text').to_s.should eq '<textarea id="long_text"></textarea>'
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'Create block tag in steps' do
|
|
22
|
-
tag = Tag.block(:body)
|
|
23
|
-
tag.attributes[:style] = 'margin: 0px'
|
|
24
|
-
|
|
25
|
-
tag.to_s.should eq '<body style="margin: 0px"></body>'
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'Create text container tag' do
|
|
29
|
-
Tag.block(:div, 'Title', :style => 'width: 100%').to_s.should eq '<div style="width: 100%">Title</div>'
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'Create tag tree' do
|
|
33
|
-
tag = Tag.block(:p) do
|
|
34
|
-
append Tag.block(:label, :for => 'text_field') {append 'Text field:'}
|
|
35
|
-
append Tag.inline(:input, :type => 'text', :id => 'text_field')
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
tag.to_s.should eq '<p><label for="text_field">Text field:</label><input type="text" id="text_field"></p>'
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it 'Block arity' do
|
|
42
|
-
def inner_tag(text)
|
|
43
|
-
Tag.block(:strong, text)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
tag = Tag.new(:div) do |t|
|
|
47
|
-
t.append inner_tag('Content')
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
tag.to_s.should eq '<div><strong>Content</strong></div>'
|
|
51
|
-
end
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Tag do
|
|
4
|
+
|
|
5
|
+
it 'Create simple tag' do
|
|
6
|
+
Tag.inline(:input, :type => 'text', :id => 'text_field').to_s.should eq '<input type="text" id="text_field">'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it 'Create simple tag in steps' do
|
|
10
|
+
tag = Tag.inline(:input)
|
|
11
|
+
tag.attributes[:type] = 'button'
|
|
12
|
+
tag.attributes[:value] = 'Click me'
|
|
13
|
+
|
|
14
|
+
tag.to_s.should eq '<input type="button" value="Click me">'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'Create block tag' do
|
|
18
|
+
Tag.block(:textarea, :id => 'long_text').to_s.should eq '<textarea id="long_text"></textarea>'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'Create block tag in steps' do
|
|
22
|
+
tag = Tag.block(:body)
|
|
23
|
+
tag.attributes[:style] = 'margin: 0px'
|
|
24
|
+
|
|
25
|
+
tag.to_s.should eq '<body style="margin: 0px"></body>'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'Create text container tag' do
|
|
29
|
+
Tag.block(:div, 'Title', :style => 'width: 100%').to_s.should eq '<div style="width: 100%">Title</div>'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'Create tag tree' do
|
|
33
|
+
tag = Tag.block(:p) do
|
|
34
|
+
append Tag.block(:label, :for => 'text_field') {append 'Text field:'}
|
|
35
|
+
append Tag.inline(:input, :type => 'text', :id => 'text_field')
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
tag.to_s.should eq '<p><label for="text_field">Text field:</label><input type="text" id="text_field"></p>'
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it 'Block arity' do
|
|
42
|
+
def inner_tag(text)
|
|
43
|
+
Tag.block(:strong, text)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
tag = Tag.new(:div) do |t|
|
|
47
|
+
t.append inner_tag('Content')
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
tag.to_s.should eq '<div><strong>Content</strong></div>'
|
|
51
|
+
end
|
|
52
52
|
end
|
data/spec/text_area_spec.rb
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Textarea do
|
|
4
|
-
|
|
5
|
-
context 'Sizes' do
|
|
6
|
-
|
|
7
|
-
it 'default' do
|
|
8
|
-
Textarea.new.to_s.should eq HtmlHelper.html_for('textareas', "#default textarea")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
InputSize::VALUES.each do |size|
|
|
12
|
-
it size do
|
|
13
|
-
Textarea.new.send(size).to_s.should eq HtmlHelper.html_for('textareas', "##{size} textarea")
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
context 'Rows' do
|
|
20
|
-
|
|
21
|
-
[5,10].each do |rows|
|
|
22
|
-
it "#{rows} rows" do
|
|
23
|
-
Textarea.new(:rows => rows).to_s.should eq HtmlHelper.html_for('textareas', "##{rows}rows textarea")
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'mixed' do
|
|
30
|
-
Textarea.new(:rows => 5).xxlarge.to_s.should eq HtmlHelper.html_for('textareas', "#mixed textarea")
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
context 'Constructors' do
|
|
34
|
-
|
|
35
|
-
InputSize::VALUES.each do |size|
|
|
36
|
-
it size do
|
|
37
|
-
Textarea.send(size, :rows => 8).to_s.should eq Textarea.new(:rows => 8).send(size).to_s
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
|
42
|
-
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Textarea do
|
|
4
|
+
|
|
5
|
+
context 'Sizes' do
|
|
6
|
+
|
|
7
|
+
it 'default' do
|
|
8
|
+
Textarea.new.to_s.should eq HtmlHelper.html_for('textareas', "#default textarea")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
InputSize::VALUES.each do |size|
|
|
12
|
+
it size do
|
|
13
|
+
Textarea.new.send(size).to_s.should eq HtmlHelper.html_for('textareas', "##{size} textarea")
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context 'Rows' do
|
|
20
|
+
|
|
21
|
+
[5,10].each do |rows|
|
|
22
|
+
it "#{rows} rows" do
|
|
23
|
+
Textarea.new(:rows => rows).to_s.should eq HtmlHelper.html_for('textareas', "##{rows}rows textarea")
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'mixed' do
|
|
30
|
+
Textarea.new(:rows => 5).xxlarge.to_s.should eq HtmlHelper.html_for('textareas', "#mixed textarea")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
context 'Constructors' do
|
|
34
|
+
|
|
35
|
+
InputSize::VALUES.each do |size|
|
|
36
|
+
it size do
|
|
37
|
+
Textarea.send(size, :rows => 8).to_s.should eq Textarea.new(:rows => 8).send(size).to_s
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
43
|
end
|
data/spec/textbox_spec.rb
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Input, '-> text' do
|
|
4
|
-
|
|
5
|
-
context 'Sizes' do
|
|
6
|
-
|
|
7
|
-
it 'default' do
|
|
8
|
-
Input.text.to_s.should eq HtmlHelper.html_for('textboxes', "#default input")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
InputSize::VALUES.each do |size|
|
|
12
|
-
it size do
|
|
13
|
-
Input.text.send(size).to_s.should eq HtmlHelper.html_for('textboxes', "##{size} input")
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
context 'Constructors' do
|
|
20
|
-
|
|
21
|
-
InputSize::VALUES.each do |size|
|
|
22
|
-
it size do
|
|
23
|
-
Input.send("text_#{size}").to_s.should eq Input.text.send(size).to_s
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
context 'Prepend and Append' do
|
|
30
|
-
|
|
31
|
-
it 'prepend' do
|
|
32
|
-
tag = ExtendedInput.new do
|
|
33
|
-
append AddOn.new '$'
|
|
34
|
-
append Input.text
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
tag.to_s.should eq HtmlHelper.html_for('textboxes', "#prepend div")
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it 'append' do
|
|
41
|
-
tag = ExtendedInput.new do
|
|
42
|
-
append Input.text
|
|
43
|
-
append Button.new 'Save'
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
tag.to_s.should eq HtmlHelper.html_for('textboxes', "#append div")
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it 'prepend and append' do
|
|
50
|
-
tag = ExtendedInput.new do
|
|
51
|
-
append AddOn.new '$'
|
|
52
|
-
append Input.text
|
|
53
|
-
append Button.new 'Save'
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
tag.to_s.should eq HtmlHelper.html_for('textboxes', "#prepend_append div")
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Input, '-> text' do
|
|
4
|
+
|
|
5
|
+
context 'Sizes' do
|
|
6
|
+
|
|
7
|
+
it 'default' do
|
|
8
|
+
Input.text.to_s.should eq HtmlHelper.html_for('textboxes', "#default input")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
InputSize::VALUES.each do |size|
|
|
12
|
+
it size do
|
|
13
|
+
Input.text.send(size).to_s.should eq HtmlHelper.html_for('textboxes', "##{size} input")
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
context 'Constructors' do
|
|
20
|
+
|
|
21
|
+
InputSize::VALUES.each do |size|
|
|
22
|
+
it size do
|
|
23
|
+
Input.send("text_#{size}").to_s.should eq Input.text.send(size).to_s
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context 'Prepend and Append' do
|
|
30
|
+
|
|
31
|
+
it 'prepend' do
|
|
32
|
+
tag = ExtendedInput.new do
|
|
33
|
+
append AddOn.new '$'
|
|
34
|
+
append Input.text
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
tag.to_s.should eq HtmlHelper.html_for('textboxes', "#prepend div")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'append' do
|
|
41
|
+
tag = ExtendedInput.new do
|
|
42
|
+
append Input.text
|
|
43
|
+
append Button.new 'Save'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
tag.to_s.should eq HtmlHelper.html_for('textboxes', "#append div")
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it 'prepend and append' do
|
|
50
|
+
tag = ExtendedInput.new do
|
|
51
|
+
append AddOn.new '$'
|
|
52
|
+
append Input.text
|
|
53
|
+
append Button.new 'Save'
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
tag.to_s.should eq HtmlHelper.html_for('textboxes', "#prepend_append div")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
60
|
end
|
data/spec/tooltip_spec.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Tooltip do
|
|
4
|
-
|
|
5
|
-
it 'default' do
|
|
6
|
-
Link.new('simple', '#').tooltip('Simple tooltip').to_s.should eq HtmlHelper.html_for('tooltips', "#default a")
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
Tooltip::POSITIONS.reject { |p| p ==:top }.each do |position|
|
|
10
|
-
it position do
|
|
11
|
-
Link.new('simple', '#').send("tooltip_#{position}", 'Simple tooltip').to_s.should eq HtmlHelper.html_for('tooltips', "##{position} a")
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Tooltip do
|
|
4
|
+
|
|
5
|
+
it 'default' do
|
|
6
|
+
Link.new('simple', '#').tooltip('Simple tooltip').to_s.should eq HtmlHelper.html_for('tooltips', "#default a")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
Tooltip::POSITIONS.reject { |p| p ==:top }.each do |position|
|
|
10
|
+
it position do
|
|
11
|
+
Link.new('simple', '#').send("tooltip_#{position}", 'Simple tooltip').to_s.should eq HtmlHelper.html_for('tooltips', "##{position} a")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
15
|
end
|
data/spec/well_spec.rb
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Well do
|
|
4
|
-
|
|
5
|
-
it 'default' do
|
|
6
|
-
Well.new('This is a well').to_s.should eq '<div class="well">This is a well</div>'
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it 'small' do
|
|
10
|
-
Well.small('This is a small well').to_s.should eq '<div class="well well-small">This is a small well</div>'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'large' do
|
|
14
|
-
Well.large('This is a large well').to_s.should eq '<div class="well well-large">This is a large well</div>'
|
|
15
|
-
end
|
|
16
|
-
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Well do
|
|
4
|
+
|
|
5
|
+
it 'default' do
|
|
6
|
+
Well.new('This is a well').to_s.should eq '<div class="well">This is a well</div>'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it 'small' do
|
|
10
|
+
Well.small('This is a small well').to_s.should eq '<div class="well well-small">This is a small well</div>'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it 'large' do
|
|
14
|
+
Well.large('This is a large well').to_s.should eq '<div class="well well-large">This is a large well</div>'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
17
|
end
|