bootstrap_helpers 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,15 @@ module BootstrapHelpers
18
18
 
19
19
  def flash_message_template(message,type)
20
20
  content_tag :div, :class=>"alert-message #{equal_bootstrap_class(type)} fade in", 'data-alert'=>'alert' do
21
- content_tag(:a, :href=>'#', :class=>'close'){"×"} + content_tag(:p) {message}
21
+ content_tag(:a, '×', :href=>'#', :class=>'close') + content_tag(:p) {message}
22
+ end
23
+ end
24
+
25
+ def flash_block_template(collection, type)
26
+ content_tag :div, :class=>"alert-message #{equal_bootstrap_class(type)} block-message fade in",
27
+ 'data-alert'=>'alert' do
28
+ concat content_tag(:a, '×', :href=>'#', :class=>'close')
29
+ collection.each {|message| concat content_tag(:p, message)}
22
30
  end
23
31
  end
24
32
 
@@ -1,3 +1,3 @@
1
1
  module BootstrapHelpers
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -53,11 +53,12 @@ module BootstrapHelpers
53
53
  flash.each do |type, content|
54
54
  case content
55
55
  when Array
56
- content.each {|message| concat flash_message_template(message, type)}
56
+ concat flash_block_template(content, type)
57
57
  when String
58
58
  concat flash_message_template(content, type)
59
59
  end
60
60
  end
61
+ flash.clear
61
62
  end
62
63
  end
63
64
 
@@ -15,12 +15,11 @@ describe SamplesController do
15
15
  it 'should have several kind of flash' do
16
16
  visit bootstrap_flash_messages_path
17
17
  page.should have_selector("div.customer_bootstrap_class")
18
- page.should have_selector("div.alert-message", :count=>5)
18
+ page.should have_selector("div.alert-message", :count=>4)
19
19
  page.should have_selector("div.alert-message.error", :text=>'Example of error')
20
20
  page.should have_selector("div.alert-message.success", :text=>'Example of notice')
21
21
  page.should have_selector("div.alert-message.info", :text=>'Example of info')
22
- page.should have_selector("div.alert-message.warning", :text=>'Example of warning(default flash message)')
23
- page.should have_selector("div.alert-message.warning", :text=>'Another warning info')
22
+ first("div.alert-message.warning").text.should include('Example of warning(default flash message)')
24
23
  find("div.info a").click
25
24
  page.should_not have_selector("div.alert-message.info")
26
25
  end
@@ -33,7 +32,7 @@ describe SamplesController do
33
32
  page.should have_selector("form.sample select")
34
33
  end
35
34
 
36
- it 'should generate bootstrap_prepended_input', :focus=>true do
35
+ it 'should generate bootstrap_prepended_input' do
37
36
  visit root_path
38
37
  page.should have_selector('div.prepended_input')
39
38
  page.should have_selector("div.prepended_input .input-prepend .add-on", :text=>'%')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergey Pchelincev
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-18 00:00:00 +02:00
18
+ date: 2011-11-19 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21