ominous 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -19
- data/app/helpers/ominous/warnings_helper.rb +1 -1
- data/app/models/ominous/closer.rb +5 -1
- data/app/models/ominous/warning.rb +5 -1
- data/app/views/ominous/warnings/_list.html.erb +3 -3
- data/db/migrate/20130131131756_add_title_and_description_to_ominous_warnings.rb +6 -0
- data/db/migrate/20130131131934_add_link_text_and_message_to_ominous_closers.rb +6 -0
- data/lib/ominous/version.rb +26 -1
- data/test/dummy/config/database.yml +6 -7
- data/test/dummy/config/locales/en.yml +0 -15
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20130131134020_create_ominous_warnings.ominous.rb +9 -0
- data/test/dummy/db/migrate/20130131134021_create_ominous_warning_closers.ominous.rb +11 -0
- data/test/dummy/db/migrate/20130131134022_create_ominous_closers.ominous.rb +12 -0
- data/test/dummy/db/migrate/20130131134023_add_title_and_description_to_ominous_warnings.ominous.rb +7 -0
- data/test/dummy/db/migrate/20130131134024_add_link_text_and_message_to_ominous_closers.ominous.rb +7 -0
- data/test/dummy/db/schema.rb +7 -3
- data/test/dummy/db/seeds/ominous/closers.yml +6 -1
- data/test/dummy/db/seeds/ominous/warnings.yml +3 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +1332 -0
- data/test/dummy/log/test.log +6036 -0
- data/test/fixtures/ominous/closers.yml +5 -1
- data/test/fixtures/ominous/warnings.yml +3 -0
- data/test/unit/ominous/closer_test.rb +20 -0
- data/test/unit/ominous/warning_test.rb +6 -0
- metadata +19 -3
@@ -2,9 +2,13 @@ one:
|
|
2
2
|
id: 1
|
3
3
|
name: closer_one
|
4
4
|
closure_method: close_and_dismiss_warning
|
5
|
+
message: Closer one
|
6
|
+
link_text: Click to close
|
5
7
|
|
6
8
|
two:
|
7
9
|
id: 2
|
8
10
|
name: closer_two
|
9
11
|
url: http://undervale.co.uk
|
10
|
-
closure_method: redirect
|
12
|
+
closure_method: redirect
|
13
|
+
message: Visit site
|
14
|
+
link_text: Click here to redirect
|
@@ -16,5 +16,25 @@ module Ominous
|
|
16
16
|
@warning.closers << @closer
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
def test_default_link_text
|
21
|
+
@closer.link_text = nil
|
22
|
+
Closer.closure_methods.keys.each do |closure_method|
|
23
|
+
@closer.closure_method = closure_method
|
24
|
+
@closer.save
|
25
|
+
link_text = "Click here to #{closure_method.to_s}".humanize
|
26
|
+
assert_equal(link_text, @closer.link_text)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_default_link_text_with_empty_string
|
31
|
+
@closer.link_text = " "
|
32
|
+
closure_method = Closer.closure_methods.keys.first
|
33
|
+
@closer.closure_method = closure_method
|
34
|
+
@closer.save
|
35
|
+
link_text = "Click here to #{closure_method.to_s}".humanize
|
36
|
+
assert_equal(link_text, @closer.link_text)
|
37
|
+
end
|
38
|
+
|
19
39
|
end
|
20
40
|
end
|
@@ -33,5 +33,11 @@ module Ominous
|
|
33
33
|
@warning.move_to_top(closer_two)
|
34
34
|
assert_equal([closer_two, closer_one], @warning.reload.closers)
|
35
35
|
end
|
36
|
+
|
37
|
+
def test_default_title
|
38
|
+
@warning.title = nil
|
39
|
+
@warning.name = 'foo_bar'
|
40
|
+
assert_equal('Foo bar', @warning.title)
|
41
|
+
end
|
36
42
|
end
|
37
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ominous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
79
|
+
name: sqlite3
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
@@ -133,7 +133,9 @@ files:
|
|
133
133
|
- config/routes.rb
|
134
134
|
- db/migrate/20121206144249_create_ominous_warnings.rb
|
135
135
|
- db/migrate/20121206153254_create_ominous_closers.rb
|
136
|
+
- db/migrate/20130131131934_add_link_text_and_message_to_ominous_closers.rb
|
136
137
|
- db/migrate/20121206145743_create_ominous_warning_closers.rb
|
138
|
+
- db/migrate/20130131131756_add_title_and_description_to_ominous_warnings.rb
|
137
139
|
- lib/ominous.rb
|
138
140
|
- lib/ominous/version.rb
|
139
141
|
- lib/ominous/engine.rb
|
@@ -161,10 +163,17 @@ files:
|
|
161
163
|
- test/dummy/README.rdoc
|
162
164
|
- test/dummy/log/test.log
|
163
165
|
- test/dummy/log/development.log
|
166
|
+
- test/dummy/db/migrate/20130131134023_add_title_and_description_to_ominous_warnings.ominous.rb
|
167
|
+
- test/dummy/db/migrate/20130131134021_create_ominous_warning_closers.ominous.rb
|
168
|
+
- test/dummy/db/migrate/20130131134020_create_ominous_warnings.ominous.rb
|
169
|
+
- test/dummy/db/migrate/20130131134024_add_link_text_and_message_to_ominous_closers.ominous.rb
|
164
170
|
- test/dummy/db/migrate/20121207090710_create_things.rb
|
171
|
+
- test/dummy/db/migrate/20130131134022_create_ominous_closers.ominous.rb
|
172
|
+
- test/dummy/db/test.sqlite3
|
165
173
|
- test/dummy/db/seeds/ominous/warnings.yml
|
166
174
|
- test/dummy/db/seeds/ominous/closers.yml
|
167
175
|
- test/dummy/db/seeds.rb
|
176
|
+
- test/dummy/db/development.sqlite3
|
168
177
|
- test/dummy/db/schema.rb
|
169
178
|
- test/dummy/config.ru
|
170
179
|
- test/dummy/public/422.html
|
@@ -277,10 +286,17 @@ test_files:
|
|
277
286
|
- test/dummy/README.rdoc
|
278
287
|
- test/dummy/log/test.log
|
279
288
|
- test/dummy/log/development.log
|
289
|
+
- test/dummy/db/migrate/20130131134023_add_title_and_description_to_ominous_warnings.ominous.rb
|
290
|
+
- test/dummy/db/migrate/20130131134021_create_ominous_warning_closers.ominous.rb
|
291
|
+
- test/dummy/db/migrate/20130131134020_create_ominous_warnings.ominous.rb
|
292
|
+
- test/dummy/db/migrate/20130131134024_add_link_text_and_message_to_ominous_closers.ominous.rb
|
280
293
|
- test/dummy/db/migrate/20121207090710_create_things.rb
|
294
|
+
- test/dummy/db/migrate/20130131134022_create_ominous_closers.ominous.rb
|
295
|
+
- test/dummy/db/test.sqlite3
|
281
296
|
- test/dummy/db/seeds/ominous/warnings.yml
|
282
297
|
- test/dummy/db/seeds/ominous/closers.yml
|
283
298
|
- test/dummy/db/seeds.rb
|
299
|
+
- test/dummy/db/development.sqlite3
|
284
300
|
- test/dummy/db/schema.rb
|
285
301
|
- test/dummy/config.ru
|
286
302
|
- test/dummy/public/422.html
|