tuning 0.2.2 → 0.2.3
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.
- checksums.yaml +4 -4
- data/README.rdoc +19 -15
- data/lib/tuning.rb +0 -1
- data/lib/tuning/action_controller/base.rb +4 -4
- data/lib/tuning/action_view/base.rb +2 -2
- data/lib/tuning/action_view/template.rb +15 -5
- data/lib/tuning/version.rb +1 -1
- data/test/active_trail_test.rb +3 -3
- data/test/button_test.rb +15 -6
- data/test/content_tag_if_test.rb +3 -3
- data/test/dummy/app/views/pages/defined.html.erb +3 -0
- data/test/dummy/app/views/pages/{other.html.erb → variable.html.erb} +0 -0
- data/test/dummy/config/locales/en.yml +4 -4
- data/test/dummy/log/test.log +2109 -0
- data/test/seo_test.rb +15 -10
- data/test/status_test.rb +8 -8
- metadata +8 -6
data/test/seo_test.rb
CHANGED
|
@@ -2,20 +2,25 @@ require 'test_helper'
|
|
|
2
2
|
|
|
3
3
|
class SeoTest < ActionView::TestCase
|
|
4
4
|
|
|
5
|
-
test "
|
|
5
|
+
test "populate meta using the path of the template as key" do
|
|
6
6
|
render template: 'pages/index', layout: 'layouts/application'
|
|
7
7
|
assert_select 'title', I18n.t('pages.index.title')
|
|
8
|
-
assert_select
|
|
9
|
-
assert_select
|
|
10
|
-
|
|
11
|
-
render template: 'pages/
|
|
12
|
-
assert_select 'title', I18n.t('pages.
|
|
13
|
-
assert_select
|
|
14
|
-
assert_select
|
|
15
|
-
|
|
8
|
+
assert_select %Q{meta[content="#{I18n.t('pages.index.description')}"]}
|
|
9
|
+
assert_select %Q{meta[content="#{I18n.t('pages.index.keywords')}"]}
|
|
10
|
+
|
|
11
|
+
render template: 'pages/variable', layout: 'layouts/application'
|
|
12
|
+
assert_select 'title', I18n.t('pages.variable.title', name: 'other')
|
|
13
|
+
assert_select %Q{meta[content="#{I18n.t('pages.variable.description', name: 'other')}"]}
|
|
14
|
+
assert_select %Q{meta[content="#{I18n.t('pages.variable.keywords', name: 'other')}"]}
|
|
15
|
+
|
|
16
16
|
render template: 'pages/empty', layout: 'layouts/application'
|
|
17
17
|
assert_select 'title', ''
|
|
18
|
-
assert_select
|
|
18
|
+
assert_select %Q{meta[content=""]}, 2
|
|
19
|
+
|
|
20
|
+
render template: 'pages/defined', layout: 'layouts/application'
|
|
21
|
+
assert_select 'title', 'title'
|
|
22
|
+
assert_select %Q{meta[content="description"]}
|
|
23
|
+
assert_select %Q{meta[content="keywords"]}
|
|
19
24
|
end
|
|
20
25
|
|
|
21
26
|
end
|
data/test/status_test.rb
CHANGED
|
@@ -2,7 +2,7 @@ require 'test_helper'
|
|
|
2
2
|
|
|
3
3
|
class StatusTest < ActionDispatch::IntegrationTest
|
|
4
4
|
|
|
5
|
-
test "
|
|
5
|
+
test "respond with status 500 if error is call" do
|
|
6
6
|
get 'error.json'
|
|
7
7
|
assert_response 500
|
|
8
8
|
assert_equal ' ', response.body
|
|
@@ -12,27 +12,27 @@ class StatusTest < ActionDispatch::IntegrationTest
|
|
|
12
12
|
assert_equal File.read(Rails.root.join('public', '500.html')), response.body
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
test "
|
|
15
|
+
test "respond with status 404 if not_found is call" do
|
|
16
16
|
get 'not_found.json'
|
|
17
17
|
assert_response 404
|
|
18
18
|
assert_equal ' ', response.body
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
get 'not_found'
|
|
21
21
|
assert_response 404
|
|
22
22
|
assert_equal File.read(Rails.root.join('public', '404.html')), response.body
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
test "
|
|
25
|
+
test "respond with status 401 if unauthorized is call" do
|
|
26
26
|
get 'unauthorized.json'
|
|
27
27
|
assert_response 401
|
|
28
28
|
assert_equal ' ', response.body
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
get 'unauthorized'
|
|
31
31
|
assert_response 401
|
|
32
32
|
assert_equal File.read(Rails.root.join('public', '422.html')), response.body
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
test "
|
|
35
|
+
test "respond with status 403 if forbidden is call" do
|
|
36
36
|
get 'forbidden.json'
|
|
37
37
|
assert_response 403
|
|
38
38
|
assert_equal ' ', response.body
|
|
@@ -42,11 +42,11 @@ class StatusTest < ActionDispatch::IntegrationTest
|
|
|
42
42
|
assert_equal File.read(Rails.root.join('public', '422.html')), response.body
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
test "
|
|
45
|
+
test "respond with status 422 if unprocessable_entity is call" do
|
|
46
46
|
get 'unprocessable_entity.json'
|
|
47
47
|
assert_response 422
|
|
48
48
|
assert_equal ' ', response.body
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
get 'unprocessable_entity'
|
|
51
51
|
assert_response 422
|
|
52
52
|
assert_equal File.read(Rails.root.join('public', '422.html')), response.body
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tuning
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Museways
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-07-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -44,7 +44,7 @@ dependencies:
|
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
46
|
version: '1.3'
|
|
47
|
-
description: Common used
|
|
47
|
+
description: Common tools used in rails extracted into a gem.
|
|
48
48
|
email:
|
|
49
49
|
- hello@mattways.com
|
|
50
50
|
executables: []
|
|
@@ -72,9 +72,10 @@ files:
|
|
|
72
72
|
- test/dummy/app/helpers/application_helper.rb
|
|
73
73
|
- test/dummy/app/views/layouts/application.html.erb
|
|
74
74
|
- test/dummy/app/views/pages/_dummy.html.erb
|
|
75
|
+
- test/dummy/app/views/pages/defined.html.erb
|
|
75
76
|
- test/dummy/app/views/pages/empty.html.erb
|
|
76
77
|
- test/dummy/app/views/pages/index.html.erb
|
|
77
|
-
- test/dummy/app/views/pages/
|
|
78
|
+
- test/dummy/app/views/pages/variable.html.erb
|
|
78
79
|
- test/dummy/bin/bundle
|
|
79
80
|
- test/dummy/bin/rails
|
|
80
81
|
- test/dummy/bin/rake
|
|
@@ -141,7 +142,7 @@ rubyforge_project:
|
|
|
141
142
|
rubygems_version: 2.2.2
|
|
142
143
|
signing_key:
|
|
143
144
|
specification_version: 4
|
|
144
|
-
summary: Tuning for
|
|
145
|
+
summary: Tuning for rails.
|
|
145
146
|
test_files:
|
|
146
147
|
- test/active_trail_test.rb
|
|
147
148
|
- test/button_test.rb
|
|
@@ -153,9 +154,10 @@ test_files:
|
|
|
153
154
|
- test/dummy/app/helpers/application_helper.rb
|
|
154
155
|
- test/dummy/app/views/layouts/application.html.erb
|
|
155
156
|
- test/dummy/app/views/pages/_dummy.html.erb
|
|
157
|
+
- test/dummy/app/views/pages/defined.html.erb
|
|
156
158
|
- test/dummy/app/views/pages/empty.html.erb
|
|
157
159
|
- test/dummy/app/views/pages/index.html.erb
|
|
158
|
-
- test/dummy/app/views/pages/
|
|
160
|
+
- test/dummy/app/views/pages/variable.html.erb
|
|
159
161
|
- test/dummy/bin/bundle
|
|
160
162
|
- test/dummy/bin/rails
|
|
161
163
|
- test/dummy/bin/rake
|