flash_rails_messages 1.0.0 → 2.2.0

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.
@@ -1,162 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- flash_rails_messages (1.0.0)
5
- rails (>= 4.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actioncable (5.0.7)
11
- actionpack (= 5.0.7)
12
- nio4r (>= 1.2, < 3.0)
13
- websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.7)
15
- actionpack (= 5.0.7)
16
- actionview (= 5.0.7)
17
- activejob (= 5.0.7)
18
- mail (~> 2.5, >= 2.5.4)
19
- rails-dom-testing (~> 2.0)
20
- actionpack (5.0.7)
21
- actionview (= 5.0.7)
22
- activesupport (= 5.0.7)
23
- rack (~> 2.0)
24
- rack-test (~> 0.6.3)
25
- rails-dom-testing (~> 2.0)
26
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.0.7)
28
- activesupport (= 5.0.7)
29
- builder (~> 3.1)
30
- erubis (~> 2.7.0)
31
- rails-dom-testing (~> 2.0)
32
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.0.7)
34
- activesupport (= 5.0.7)
35
- globalid (>= 0.3.6)
36
- activemodel (5.0.7)
37
- activesupport (= 5.0.7)
38
- activerecord (5.0.7)
39
- activemodel (= 5.0.7)
40
- activesupport (= 5.0.7)
41
- arel (~> 7.0)
42
- activesupport (5.0.7)
43
- concurrent-ruby (~> 1.0, >= 1.0.2)
44
- i18n (>= 0.7, < 2)
45
- minitest (~> 5.1)
46
- tzinfo (~> 1.1)
47
- appraisal (2.2.0)
48
- bundler
49
- rake
50
- thor (>= 0.14.0)
51
- arel (7.1.4)
52
- builder (3.2.3)
53
- concurrent-ruby (1.0.5)
54
- coveralls (0.7.2)
55
- multi_json (~> 1.3)
56
- rest-client (= 1.6.7)
57
- simplecov (>= 0.7)
58
- term-ansicolor (= 1.2.2)
59
- thor (= 0.18.1)
60
- crass (1.0.4)
61
- diff-lcs (1.3)
62
- docile (1.3.0)
63
- erubis (2.7.0)
64
- globalid (0.4.1)
65
- activesupport (>= 4.2.0)
66
- i18n (1.0.1)
67
- concurrent-ruby (~> 1.0)
68
- json (2.1.0)
69
- loofah (2.2.2)
70
- crass (~> 1.0.2)
71
- nokogiri (>= 1.5.9)
72
- mail (2.7.0)
73
- mini_mime (>= 0.1.1)
74
- method_source (0.9.0)
75
- mime-types (3.1)
76
- mime-types-data (~> 3.2015)
77
- mime-types-data (3.2016.0521)
78
- mini_mime (1.0.0)
79
- mini_portile2 (2.3.0)
80
- minitest (5.11.3)
81
- multi_json (1.13.1)
82
- nio4r (2.3.1)
83
- nokogiri (1.8.2)
84
- mini_portile2 (~> 2.3.0)
85
- rack (2.0.5)
86
- rack-test (0.6.3)
87
- rack (>= 1.0)
88
- rails (5.0.7)
89
- actioncable (= 5.0.7)
90
- actionmailer (= 5.0.7)
91
- actionpack (= 5.0.7)
92
- actionview (= 5.0.7)
93
- activejob (= 5.0.7)
94
- activemodel (= 5.0.7)
95
- activerecord (= 5.0.7)
96
- activesupport (= 5.0.7)
97
- bundler (>= 1.3.0)
98
- railties (= 5.0.7)
99
- sprockets-rails (>= 2.0.0)
100
- rails-dom-testing (2.0.3)
101
- activesupport (>= 4.2.0)
102
- nokogiri (>= 1.6)
103
- rails-html-sanitizer (1.0.4)
104
- loofah (~> 2.2, >= 2.2.2)
105
- railties (5.0.7)
106
- actionpack (= 5.0.7)
107
- activesupport (= 5.0.7)
108
- method_source
109
- rake (>= 0.8.7)
110
- thor (>= 0.18.1, < 2.0)
111
- rake (12.3.1)
112
- rest-client (1.6.7)
113
- mime-types (>= 1.16)
114
- rspec (3.7.0)
115
- rspec-core (~> 3.7.0)
116
- rspec-expectations (~> 3.7.0)
117
- rspec-mocks (~> 3.7.0)
118
- rspec-core (3.7.1)
119
- rspec-support (~> 3.7.0)
120
- rspec-expectations (3.7.0)
121
- diff-lcs (>= 1.2.0, < 2.0)
122
- rspec-support (~> 3.7.0)
123
- rspec-mocks (3.7.0)
124
- diff-lcs (>= 1.2.0, < 2.0)
125
- rspec-support (~> 3.7.0)
126
- rspec-support (3.7.1)
127
- simplecov (0.16.1)
128
- docile (~> 1.1)
129
- json (>= 1.8, < 3)
130
- simplecov-html (~> 0.10.0)
131
- simplecov-html (0.10.2)
132
- sprockets (3.7.1)
133
- concurrent-ruby (~> 1.0)
134
- rack (> 1, < 3)
135
- sprockets-rails (3.2.1)
136
- actionpack (>= 4.0)
137
- activesupport (>= 4.0)
138
- sprockets (>= 3.0.0)
139
- term-ansicolor (1.2.2)
140
- tins (~> 0.8)
141
- thor (0.18.1)
142
- thread_safe (0.3.6)
143
- tins (0.13.2)
144
- tzinfo (1.2.5)
145
- thread_safe (~> 0.1)
146
- websocket-driver (0.6.5)
147
- websocket-extensions (>= 0.1.0)
148
- websocket-extensions (0.1.3)
149
-
150
- PLATFORMS
151
- ruby
152
-
153
- DEPENDENCIES
154
- appraisal
155
- coveralls
156
- flash_rails_messages!
157
- rails (~> 5.0.0)
158
- rspec (~> 3.4)
159
- simplecov
160
-
161
- BUNDLED WITH
162
- 1.16.2
@@ -1,65 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe FlashRailsMessages::Helper do
4
- let!(:subject){ ActionView::Base.new }
5
-
6
- describe '#render_flash_messages' do
7
- context 'when flash does not have messages' do
8
- it 'returns nothing' do
9
- allow(subject).to receive(:flash).and_return({})
10
- expect(subject.render_flash_messages).to eql('')
11
- end
12
- end
13
-
14
- context 'when flash has messages' do
15
- context 'when flash type is notice' do
16
- it 'returns the correct message' do
17
- allow(subject).to receive(:flash).and_return({ notice: 'notice' })
18
- alert_expected = alert_element('notice', 'info')
19
- expect(subject.render_flash_messages).to eql(alert_expected)
20
- end
21
- end
22
-
23
- context 'when flash type is success' do
24
- it 'returns the correct message' do
25
- allow(subject).to receive(:flash).and_return({ success: 'success' })
26
- alert_expected = alert_element('success', 'success')
27
- expect(subject.render_flash_messages).to eql(alert_expected)
28
- end
29
- end
30
-
31
- context 'when flash type is alert' do
32
- it 'returns the correct message' do
33
- allow(subject).to receive(:flash).and_return({ alert: 'alert' })
34
- alert_expected = alert_element('alert', 'error')
35
- expect(subject.render_flash_messages).to eql(alert_expected)
36
- end
37
- end
38
-
39
- context 'when flash type is error' do
40
- it 'returns the correct message' do
41
- allow(subject).to receive(:flash).and_return({ error: 'error' })
42
- alert_expected = alert_element('error', 'error')
43
- expect(subject.render_flash_messages).to eql(alert_expected)
44
- end
45
- end
46
-
47
- context 'when has more than one message' do
48
- it 'returns all the correct messages' do
49
- allow(subject).to receive(:flash).and_return({ alert: 'alert', notice: 'notice' })
50
- alerts_expected = alert_element('alert', 'error') +
51
- alert_element('notice', 'info')
52
- expect(subject.render_flash_messages).to eql(alerts_expected)
53
- end
54
- end
55
- end
56
- end
57
-
58
- def alert_element msg, klass
59
- subject.content_tag(:div, close_element + msg.html_safe, class: 'alert')
60
- end
61
-
62
- def close_element
63
- subject.content_tag(:a, '&times;'.html_safe, class: 'close', href: '#')
64
- end
65
- end
data/spec/spec_helper.rb DELETED
@@ -1,9 +0,0 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
-
4
- require 'simplecov'
5
- SimpleCov.start
6
-
7
- require 'action_view'
8
- require 'flash_rails_messages'
9
- require 'rails/all'