h2ocube_rails_helper 0.0.16 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/Gemfile +0 -3
- data/README.md +0 -1
- data/Rakefile +7 -7
- data/h2ocube_rails_helper.gemspec +9 -1
- data/h2ocube_rails_helper.sublime-project +15 -0
- data/lib/h2ocube_rails_helper.rb +93 -89
- data/spec/fake_app/models.rb +14 -0
- data/spec/fake_app/rails_app.rb +33 -0
- data/spec/helpers/render_canonical_spec.rb +16 -0
- data/spec/helpers/render_description_spec.rb +37 -0
- data/spec/helpers/render_ga_spec.rb +38 -0
- data/{test/render_html_class_test.rb → spec/helpers/render_html_class_spec.rb} +44 -45
- data/spec/helpers/render_keywords_spec.rb +39 -0
- data/spec/helpers/render_title_spec.rb +56 -0
- data/spec/spec_helper.rb +24 -0
- metadata +120 -57
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -20
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -22
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -23
- data/test/dummy/config/environments/production.rb +0 -49
- data/test/dummy/config/environments/test.rb +0 -24
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -58
- data/test/dummy/script/rails +0 -6
- data/test/render_canonical_test.rb +0 -16
- data/test/render_description_test.rb +0 -37
- data/test/render_ga_test.rb +0 -37
- data/test/render_keywords_test.rb +0 -41
- data/test/render_title_test.rb +0 -56
- data/test/test_helper.rb +0 -7
data/test/render_title_test.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class RenderTitleClass < ActionView::TestCase
|
4
|
-
test 'simple' do
|
5
|
-
self.class_eval do
|
6
|
-
undef_method :resource
|
7
|
-
end
|
8
|
-
assert_equal render_title, '<title>title</title>'
|
9
|
-
end
|
10
|
-
|
11
|
-
test '@title' do
|
12
|
-
@title = '@title'
|
13
|
-
assert_equal render_title, '<title>@title - title</title>'
|
14
|
-
@title = ['@title', ' ', '', nil]
|
15
|
-
assert_equal render_title, '<title>@title - title</title>'
|
16
|
-
end
|
17
|
-
|
18
|
-
test 'resource' do
|
19
|
-
def resource
|
20
|
-
Resource.new
|
21
|
-
end
|
22
|
-
|
23
|
-
assert_equal render_title, '<title>Resource Name - Class Name - title</title>'
|
24
|
-
end
|
25
|
-
|
26
|
-
test '@_title' do
|
27
|
-
@_title = '@_title'
|
28
|
-
assert_equal render_title, '<title>@_title</title>'
|
29
|
-
end
|
30
|
-
|
31
|
-
test 'opts' do
|
32
|
-
assert_equal render_title(title: 'opts'), '<title>opts</title>'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class HelperSettings
|
37
|
-
def self.title
|
38
|
-
'title'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
class ResourceModelName
|
43
|
-
def human
|
44
|
-
'Class Name'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
class Resource
|
49
|
-
def title
|
50
|
-
'Resource Name'
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.model_name
|
54
|
-
ResourceModelName.new
|
55
|
-
end
|
56
|
-
end
|