tuning 0.1.2 → 0.1.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/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/tuning/action_controller/base.rb +8 -6
- data/lib/tuning/action_view/base.rb +5 -5
- data/lib/tuning/version.rb +1 -1
- data/test/active_trail_test.rb +33 -0
- data/test/button_test.rb +17 -0
- data/test/content_tag_if_test.rb +17 -0
- data/test/dummy/app/controllers/status_controller.rb +27 -0
- data/test/dummy/app/views/layouts/application.html.erb +11 -11
- data/test/dummy/app/views/pages/index.html.erb +1 -0
- data/test/dummy/app/views/pages/other.html.erb +1 -0
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/config/initializers/secret_token.rb +1 -0
- data/test/dummy/config/locales/en.yml +11 -22
- data/test/dummy/config/routes.rb +6 -52
- data/test/dummy/log/test.log +4387 -84
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/set_meta_test.rb +17 -0
- data/test/status_test.rb +55 -0
- data/test/test_helper.rb +3 -0
- metadata +47 -25
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -14
- data/test/view_test.rb +0 -21
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SetMetaTest < ActionView::TestCase
|
4
|
+
|
5
|
+
test "should populate meta using the path of the template as key" do
|
6
|
+
render template: 'pages/index', layout: 'layouts/application'
|
7
|
+
assert_select 'title', I18n.t('pages.index.meta.title')
|
8
|
+
assert_select "meta[content='#{I18n.t('pages.index.meta.description')}']"
|
9
|
+
assert_select "meta[content='#{I18n.t('pages.index.meta.keywords')}']"
|
10
|
+
|
11
|
+
render template: 'pages/other', layout: 'layouts/application'
|
12
|
+
assert_select 'title', I18n.t('pages.other.meta.title', name: 'other')
|
13
|
+
assert_select "meta[content='#{I18n.t('pages.other.meta.description', name: 'other')}']"
|
14
|
+
assert_select "meta[content='#{I18n.t('pages.other.meta.keywords', name: 'other')}']"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/test/status_test.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class StatusTest < ActionDispatch::IntegrationTest
|
4
|
+
|
5
|
+
test "should respond with status 500 if error is call" do
|
6
|
+
get 'error.json'
|
7
|
+
assert_response 500
|
8
|
+
assert_equal ' ', response.body
|
9
|
+
|
10
|
+
get 'error'
|
11
|
+
assert_response 500
|
12
|
+
assert_equal File.read(Rails.root.join('public', '500.html')), response.body
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should respond with status 404 if not_found is call" do
|
16
|
+
get 'not_found.json'
|
17
|
+
assert_response 404
|
18
|
+
assert_equal ' ', response.body
|
19
|
+
|
20
|
+
get 'not_found'
|
21
|
+
assert_response 404
|
22
|
+
assert_equal File.read(Rails.root.join('public', '404.html')), response.body
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should respond with status 401 if unauthorized is call" do
|
26
|
+
get 'unauthorized.json'
|
27
|
+
assert_response 401
|
28
|
+
assert_equal ' ', response.body
|
29
|
+
|
30
|
+
get 'unauthorized'
|
31
|
+
assert_response 401
|
32
|
+
assert_equal File.read(Rails.root.join('public', '422.html')), response.body
|
33
|
+
end
|
34
|
+
|
35
|
+
test "should respond with status 403 if forbidden is call" do
|
36
|
+
get 'forbidden.json'
|
37
|
+
assert_response 403
|
38
|
+
assert_equal ' ', response.body
|
39
|
+
|
40
|
+
get 'forbidden'
|
41
|
+
assert_response 403
|
42
|
+
assert_equal File.read(Rails.root.join('public', '422.html')), response.body
|
43
|
+
end
|
44
|
+
|
45
|
+
test "should respond with status 422 if unprocessable_entity is call" do
|
46
|
+
get 'unprocessable_entity.json'
|
47
|
+
assert_response 422
|
48
|
+
assert_equal ' ', response.body
|
49
|
+
|
50
|
+
get 'unprocessable_entity'
|
51
|
+
assert_response 422
|
52
|
+
assert_equal File.read(Rails.root.join('public', '422.html')), response.body
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -19,3 +19,6 @@ config = YAML::load(File.read(File.expand_path('../dummy/config/database.yml', _
|
|
19
19
|
config['test']['adapter'] = 'jdbcsqlite3' if RUBY_PLATFORM == 'java'
|
20
20
|
ActiveRecord::Base.establish_connection(config['test'])
|
21
21
|
load(File.expand_path('../dummy/db/schema.rb', __FILE__))
|
22
|
+
|
23
|
+
# Include helpers
|
24
|
+
ActionView::TestCase.send :include, Tuning::ActionView::Base
|
metadata
CHANGED
@@ -1,66 +1,75 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tuning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Common used tools extracted into a gem.
|
42
42
|
email:
|
43
|
-
-
|
43
|
+
- hello@mattways.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.rdoc
|
50
|
+
- Rakefile
|
51
|
+
- lib/tuning.rb
|
48
52
|
- lib/tuning/action_controller/base.rb
|
49
53
|
- lib/tuning/action_view/base.rb
|
50
54
|
- lib/tuning/railtie.rb
|
51
55
|
- lib/tuning/version.rb
|
52
|
-
-
|
53
|
-
-
|
54
|
-
-
|
55
|
-
- README.rdoc
|
56
|
+
- test/active_trail_test.rb
|
57
|
+
- test/button_test.rb
|
58
|
+
- test/content_tag_if_test.rb
|
59
|
+
- test/dummy/README.rdoc
|
60
|
+
- test/dummy/Rakefile
|
56
61
|
- test/dummy/app/assets/javascripts/application.js
|
57
62
|
- test/dummy/app/assets/stylesheets/application.css
|
58
63
|
- test/dummy/app/controllers/application_controller.rb
|
64
|
+
- test/dummy/app/controllers/status_controller.rb
|
59
65
|
- test/dummy/app/helpers/application_helper.rb
|
60
66
|
- test/dummy/app/views/layouts/application.html.erb
|
67
|
+
- test/dummy/app/views/pages/index.html.erb
|
68
|
+
- test/dummy/app/views/pages/other.html.erb
|
61
69
|
- test/dummy/bin/bundle
|
62
70
|
- test/dummy/bin/rails
|
63
71
|
- test/dummy/bin/rake
|
72
|
+
- test/dummy/config.ru
|
64
73
|
- test/dummy/config/application.rb
|
65
74
|
- test/dummy/config/boot.rb
|
66
75
|
- test/dummy/config/database.yml
|
@@ -77,20 +86,22 @@ files:
|
|
77
86
|
- test/dummy/config/initializers/wrap_parameters.rb
|
78
87
|
- test/dummy/config/locales/en.yml
|
79
88
|
- test/dummy/config/routes.rb
|
80
|
-
- test/dummy/config.ru
|
81
|
-
- test/dummy/db/development.sqlite3
|
82
89
|
- test/dummy/db/schema.rb
|
83
|
-
- test/dummy/log/development.log
|
84
90
|
- test/dummy/log/test.log
|
85
91
|
- test/dummy/public/404.html
|
86
92
|
- test/dummy/public/422.html
|
87
93
|
- test/dummy/public/500.html
|
88
94
|
- test/dummy/public/favicon.ico
|
89
|
-
- test/dummy/
|
90
|
-
- test/dummy/
|
95
|
+
- test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
|
96
|
+
- test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
97
|
+
- test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
|
98
|
+
- test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
99
|
+
- test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
100
|
+
- test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
101
|
+
- test/set_meta_test.rb
|
102
|
+
- test/status_test.rb
|
91
103
|
- test/test_helper.rb
|
92
|
-
|
93
|
-
homepage: https://github.com/mattways/tuning
|
104
|
+
homepage: https://github.com/museways/tuning
|
94
105
|
licenses:
|
95
106
|
- MIT
|
96
107
|
metadata: {}
|
@@ -100,26 +111,32 @@ require_paths:
|
|
100
111
|
- lib
|
101
112
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
113
|
requirements:
|
103
|
-
- -
|
114
|
+
- - ">="
|
104
115
|
- !ruby/object:Gem::Version
|
105
116
|
version: '0'
|
106
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
118
|
requirements:
|
108
|
-
- -
|
119
|
+
- - ">="
|
109
120
|
- !ruby/object:Gem::Version
|
110
121
|
version: '0'
|
111
122
|
requirements: []
|
112
123
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.2.2
|
114
125
|
signing_key:
|
115
126
|
specification_version: 4
|
116
127
|
summary: Tuning for Rails.
|
117
128
|
test_files:
|
129
|
+
- test/active_trail_test.rb
|
130
|
+
- test/button_test.rb
|
131
|
+
- test/content_tag_if_test.rb
|
118
132
|
- test/dummy/app/assets/javascripts/application.js
|
119
133
|
- test/dummy/app/assets/stylesheets/application.css
|
120
134
|
- test/dummy/app/controllers/application_controller.rb
|
135
|
+
- test/dummy/app/controllers/status_controller.rb
|
121
136
|
- test/dummy/app/helpers/application_helper.rb
|
122
137
|
- test/dummy/app/views/layouts/application.html.erb
|
138
|
+
- test/dummy/app/views/pages/index.html.erb
|
139
|
+
- test/dummy/app/views/pages/other.html.erb
|
123
140
|
- test/dummy/bin/bundle
|
124
141
|
- test/dummy/bin/rails
|
125
142
|
- test/dummy/bin/rake
|
@@ -140,9 +157,7 @@ test_files:
|
|
140
157
|
- test/dummy/config/locales/en.yml
|
141
158
|
- test/dummy/config/routes.rb
|
142
159
|
- test/dummy/config.ru
|
143
|
-
- test/dummy/db/development.sqlite3
|
144
160
|
- test/dummy/db/schema.rb
|
145
|
-
- test/dummy/log/development.log
|
146
161
|
- test/dummy/log/test.log
|
147
162
|
- test/dummy/public/404.html
|
148
163
|
- test/dummy/public/422.html
|
@@ -150,5 +165,12 @@ test_files:
|
|
150
165
|
- test/dummy/public/favicon.ico
|
151
166
|
- test/dummy/Rakefile
|
152
167
|
- test/dummy/README.rdoc
|
168
|
+
- test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
|
169
|
+
- test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
|
170
|
+
- test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
|
171
|
+
- test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
172
|
+
- test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
173
|
+
- test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
174
|
+
- test/set_meta_test.rb
|
175
|
+
- test/status_test.rb
|
153
176
|
- test/test_helper.rb
|
154
|
-
- test/view_test.rb
|
Binary file
|
@@ -1,14 +0,0 @@
|
|
1
|
-
[1m[36m (3.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
-
[1m[35m (3.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4
|
-
[1m[36m (79.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
5
|
-
[1m[35m (5.7ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
6
|
-
[1m[36m (0.2ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
7
|
-
[1m[35m (6.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
8
|
-
[1m[36m (35.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
9
|
-
[1m[35m (6.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
10
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
11
|
-
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
12
|
-
[1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
13
|
-
[1m[36m (0.0ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
14
|
-
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
data/test/view_test.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ViewTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
setup do
|
6
|
-
@instance = ActionView::Base.new
|
7
|
-
end
|
8
|
-
|
9
|
-
test "should have contenta_tag_if method" do
|
10
|
-
assert @instance.respond_to?(:content_tag_if)
|
11
|
-
end
|
12
|
-
|
13
|
-
test "should have active_trail? method" do
|
14
|
-
assert @instance.respond_to?(:active_trail?)
|
15
|
-
end
|
16
|
-
|
17
|
-
test "should have set_meta method" do
|
18
|
-
assert @instance.respond_to?(:set_meta)
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|