i18n_form_helper 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +38 -0
- data/lib/i18n_form_helper/form_select_options.rb +1292 -0
- data/lib/i18n_form_helper/version.rb +3 -0
- data/lib/i18n_form_helper.rb +35 -0
- data/lib/tasks/i18n_form_helper_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/javascripts/languages.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/languages.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/languages_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/languages_helper.rb +2 -0
- data/test/dummy/app/models/language.rb +3 -0
- data/test/dummy/app/views/languages/index.html.erb +49 -0
- data/test/dummy/app/views/layouts/application.html.erb +21 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +60 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20131217053022_create_languages.rb +9 -0
- data/test/dummy/db/schema.rb +22 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +313 -0
- data/test/dummy/log/test.log +1318 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/languages.yml +7 -0
- data/test/dummy/test/functional/languages_controller_test.rb +9 -0
- data/test/dummy/test/unit/helpers/languages_helper_test.rb +4 -0
- data/test/dummy/test/unit/language_test.rb +7 -0
- data/test/dummy/tmp/cache/assets/CA2/BF0/sprockets%2Fb56ac30a59512f109e072c6c351195a8 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/D2F/B50/sprockets%2Feb222894dcb95bae4f2a7e227222b006 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/DAA/470/sprockets%2Fafb782256c9207973dfb6e63becb9b5c +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DEA/820/sprockets%2Fa3eb909f1fba592b6a225bc63abc1c2e +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/capybara/capybara-201312171702124011360920.html +203 -0
- data/test/dummy/tmp/capybara/capybara-201312171702595894767062.html +203 -0
- data/test/dummy/tmp/capybara/capybara-201312171703428962416286.html +203 -0
- data/test/dummy/tmp/capybara/capybara-201312171704117555796382.html +203 -0
- data/test/dummy/tmp/capybara/capybara-201312172053002673059159.html +1088 -0
- data/test/dummy/tmp/capybara/capybara-201312172056035791412287.html +1088 -0
- data/test/dummy/tmp/capybara/capybara-201312172100198351601528.html +1088 -0
- data/test/dummy/tmp/capybara/capybara-201312172107323114657460.html +1088 -0
- data/test/dummy/tmp/capybara/capybara-201312172108211650964312.html +1090 -0
- data/test/dummy/tmp/capybara/capybara-20131217211129299664262.html +1091 -0
- data/test/dummy/tmp/capybara/capybara-201312172113193631383614.html +1091 -0
- data/test/dummy/tmp/capybara/capybara-201312172117421338188983.html +1088 -0
- data/test/form_select_options_test.rb +38 -0
- data/test/i18n_form_helper_test.rb +20 -0
- data/test/test_helper.rb +22 -0
- metadata +203 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'i18n_form_helper/form_select_options'
|
3
|
+
|
4
|
+
class FormSelectOptionsTest < ActiveSupport::TestCase
|
5
|
+
|
6
|
+
def test_language_english_name_to_english_name
|
7
|
+
assert_not_nil(FormSelectOptions::LanguageOptions.english_name_to_english_name,
|
8
|
+
"english_name_to_english_name is nil")
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_language_english_name_exists
|
12
|
+
list = FormSelectOptions::LanguageOptions.english_name_to_english_name
|
13
|
+
assert(list.index(["English", "English"]) > 0, "English name doesn't exist")
|
14
|
+
end
|
15
|
+
|
16
|
+
# country select tests
|
17
|
+
|
18
|
+
def test_english_country_name_to_english_country_name
|
19
|
+
assert_not_nil(FormSelectOptions::CountryOptions.english_country_name_to_english_country_name,
|
20
|
+
"english_country_name_to_english_country_name is nil")
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_australia_english_country_name_exists
|
24
|
+
list = FormSelectOptions::CountryOptions.english_country_name_to_english_country_name
|
25
|
+
assert(list.index(["Australia", "Australia"]) > 0, "Australia name doesn't exist")
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_code_to_english_country_name
|
29
|
+
assert_not_nil(FormSelectOptions::CountryOptions.code_to_english_country_name,
|
30
|
+
"code_to_english_country_name is nil")
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_australia_code_to_english_country_name_exists
|
34
|
+
list = FormSelectOptions::CountryOptions.code_to_english_country_name
|
35
|
+
assert(list.index(["AU", "Australia"]) > 0, "Australia code and name doesn't exist")
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class I18nFormHelperTest < ActionDispatch::IntegrationTest
|
4
|
+
|
5
|
+
test "language select on index" do
|
6
|
+
visit languages_path
|
7
|
+
page.assert_selector('h1', text: 'Languages#index')
|
8
|
+
page.assert_selector('div#language_name_select')
|
9
|
+
page.assert_selector('div#language_native_select')
|
10
|
+
page.assert_selector('div#language_code_select')
|
11
|
+
page.assert_selector('div#country_name_select')
|
12
|
+
page.assert_selector('div#country_code_select')
|
13
|
+
|
14
|
+
select('English', :from => 'language[language_name_select]')
|
15
|
+
select('English', :from => 'language[language_native_select]')
|
16
|
+
select('EN', :from => 'language[language_code_select]')
|
17
|
+
select('Australia', :from => 'language[country_name_select]')
|
18
|
+
select('AU', :from => 'language[country_code_select]')
|
19
|
+
end
|
20
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
require 'capybara/rails'
|
7
|
+
require 'capybara/rspec'
|
8
|
+
|
9
|
+
Rails.backtrace_cleaner.remove_silencers!
|
10
|
+
|
11
|
+
# Load support files
|
12
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
13
|
+
|
14
|
+
# Load fixtures from the engine
|
15
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
16
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
17
|
+
end
|
18
|
+
|
19
|
+
class ActionDispatch::IntegrationTest
|
20
|
+
# Make the Capybara DSL available in all integration tests
|
21
|
+
include Capybara::DSL
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: i18n_form_helper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matt Elliott
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.2.13
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.2.13
|
27
|
+
description: Description of I18nFormHelper.
|
28
|
+
email:
|
29
|
+
- mcelliott80@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- lib/i18n_form_helper/form_select_options.rb
|
35
|
+
- lib/i18n_form_helper/version.rb
|
36
|
+
- lib/i18n_form_helper.rb
|
37
|
+
- lib/tasks/i18n_form_helper_tasks.rake
|
38
|
+
- MIT-LICENSE
|
39
|
+
- Rakefile
|
40
|
+
- README.rdoc
|
41
|
+
- test/dummy/app/assets/javascripts/application.js
|
42
|
+
- test/dummy/app/assets/javascripts/languages.js
|
43
|
+
- test/dummy/app/assets/stylesheets/application.css
|
44
|
+
- test/dummy/app/assets/stylesheets/languages.css
|
45
|
+
- test/dummy/app/controllers/application_controller.rb
|
46
|
+
- test/dummy/app/controllers/languages_controller.rb
|
47
|
+
- test/dummy/app/helpers/application_helper.rb
|
48
|
+
- test/dummy/app/helpers/languages_helper.rb
|
49
|
+
- test/dummy/app/models/language.rb
|
50
|
+
- test/dummy/app/views/languages/index.html.erb
|
51
|
+
- test/dummy/app/views/layouts/application.html.erb
|
52
|
+
- test/dummy/config/application.rb
|
53
|
+
- test/dummy/config/boot.rb
|
54
|
+
- test/dummy/config/database.yml
|
55
|
+
- test/dummy/config/environment.rb
|
56
|
+
- test/dummy/config/environments/development.rb
|
57
|
+
- test/dummy/config/environments/production.rb
|
58
|
+
- test/dummy/config/environments/test.rb
|
59
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
60
|
+
- test/dummy/config/initializers/inflections.rb
|
61
|
+
- test/dummy/config/initializers/mime_types.rb
|
62
|
+
- test/dummy/config/initializers/secret_token.rb
|
63
|
+
- test/dummy/config/initializers/session_store.rb
|
64
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
65
|
+
- test/dummy/config/locales/en.yml
|
66
|
+
- test/dummy/config/routes.rb
|
67
|
+
- test/dummy/config.ru
|
68
|
+
- test/dummy/db/development.sqlite3
|
69
|
+
- test/dummy/db/migrate/20131217053022_create_languages.rb
|
70
|
+
- test/dummy/db/schema.rb
|
71
|
+
- test/dummy/db/test.sqlite3
|
72
|
+
- test/dummy/log/development.log
|
73
|
+
- test/dummy/log/test.log
|
74
|
+
- test/dummy/public/404.html
|
75
|
+
- test/dummy/public/422.html
|
76
|
+
- test/dummy/public/500.html
|
77
|
+
- test/dummy/public/favicon.ico
|
78
|
+
- test/dummy/Rakefile
|
79
|
+
- test/dummy/README.rdoc
|
80
|
+
- test/dummy/script/rails
|
81
|
+
- test/dummy/test/fixtures/languages.yml
|
82
|
+
- test/dummy/test/functional/languages_controller_test.rb
|
83
|
+
- test/dummy/test/unit/helpers/languages_helper_test.rb
|
84
|
+
- test/dummy/test/unit/language_test.rb
|
85
|
+
- test/dummy/tmp/cache/assets/CA2/BF0/sprockets%2Fb56ac30a59512f109e072c6c351195a8
|
86
|
+
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
87
|
+
- test/dummy/tmp/cache/assets/D2F/B50/sprockets%2Feb222894dcb95bae4f2a7e227222b006
|
88
|
+
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
89
|
+
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
90
|
+
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
91
|
+
- test/dummy/tmp/cache/assets/DAA/470/sprockets%2Fafb782256c9207973dfb6e63becb9b5c
|
92
|
+
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
93
|
+
- test/dummy/tmp/cache/assets/DEA/820/sprockets%2Fa3eb909f1fba592b6a225bc63abc1c2e
|
94
|
+
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
95
|
+
- test/dummy/tmp/capybara/capybara-201312171702124011360920.html
|
96
|
+
- test/dummy/tmp/capybara/capybara-201312171702595894767062.html
|
97
|
+
- test/dummy/tmp/capybara/capybara-201312171703428962416286.html
|
98
|
+
- test/dummy/tmp/capybara/capybara-201312171704117555796382.html
|
99
|
+
- test/dummy/tmp/capybara/capybara-201312172053002673059159.html
|
100
|
+
- test/dummy/tmp/capybara/capybara-201312172056035791412287.html
|
101
|
+
- test/dummy/tmp/capybara/capybara-201312172100198351601528.html
|
102
|
+
- test/dummy/tmp/capybara/capybara-201312172107323114657460.html
|
103
|
+
- test/dummy/tmp/capybara/capybara-201312172108211650964312.html
|
104
|
+
- test/dummy/tmp/capybara/capybara-20131217211129299664262.html
|
105
|
+
- test/dummy/tmp/capybara/capybara-201312172113193631383614.html
|
106
|
+
- test/dummy/tmp/capybara/capybara-201312172117421338188983.html
|
107
|
+
- test/form_select_options_test.rb
|
108
|
+
- test/i18n_form_helper_test.rb
|
109
|
+
- test/test_helper.rb
|
110
|
+
homepage: ''
|
111
|
+
licenses: []
|
112
|
+
metadata: {}
|
113
|
+
post_install_message:
|
114
|
+
rdoc_options: []
|
115
|
+
require_paths:
|
116
|
+
- lib
|
117
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
requirements: []
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 2.1.9
|
130
|
+
signing_key:
|
131
|
+
specification_version: 4
|
132
|
+
summary: Summary of I18nFormHelper.
|
133
|
+
test_files:
|
134
|
+
- test/dummy/app/assets/javascripts/application.js
|
135
|
+
- test/dummy/app/assets/javascripts/languages.js
|
136
|
+
- test/dummy/app/assets/stylesheets/application.css
|
137
|
+
- test/dummy/app/assets/stylesheets/languages.css
|
138
|
+
- test/dummy/app/controllers/application_controller.rb
|
139
|
+
- test/dummy/app/controllers/languages_controller.rb
|
140
|
+
- test/dummy/app/helpers/application_helper.rb
|
141
|
+
- test/dummy/app/helpers/languages_helper.rb
|
142
|
+
- test/dummy/app/models/language.rb
|
143
|
+
- test/dummy/app/views/languages/index.html.erb
|
144
|
+
- test/dummy/app/views/layouts/application.html.erb
|
145
|
+
- test/dummy/config/application.rb
|
146
|
+
- test/dummy/config/boot.rb
|
147
|
+
- test/dummy/config/database.yml
|
148
|
+
- test/dummy/config/environment.rb
|
149
|
+
- test/dummy/config/environments/development.rb
|
150
|
+
- test/dummy/config/environments/production.rb
|
151
|
+
- test/dummy/config/environments/test.rb
|
152
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
153
|
+
- test/dummy/config/initializers/inflections.rb
|
154
|
+
- test/dummy/config/initializers/mime_types.rb
|
155
|
+
- test/dummy/config/initializers/secret_token.rb
|
156
|
+
- test/dummy/config/initializers/session_store.rb
|
157
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
158
|
+
- test/dummy/config/locales/en.yml
|
159
|
+
- test/dummy/config/routes.rb
|
160
|
+
- test/dummy/config.ru
|
161
|
+
- test/dummy/db/development.sqlite3
|
162
|
+
- test/dummy/db/migrate/20131217053022_create_languages.rb
|
163
|
+
- test/dummy/db/schema.rb
|
164
|
+
- test/dummy/db/test.sqlite3
|
165
|
+
- test/dummy/log/development.log
|
166
|
+
- test/dummy/log/test.log
|
167
|
+
- test/dummy/public/404.html
|
168
|
+
- test/dummy/public/422.html
|
169
|
+
- test/dummy/public/500.html
|
170
|
+
- test/dummy/public/favicon.ico
|
171
|
+
- test/dummy/Rakefile
|
172
|
+
- test/dummy/README.rdoc
|
173
|
+
- test/dummy/script/rails
|
174
|
+
- test/dummy/test/fixtures/languages.yml
|
175
|
+
- test/dummy/test/functional/languages_controller_test.rb
|
176
|
+
- test/dummy/test/unit/helpers/languages_helper_test.rb
|
177
|
+
- test/dummy/test/unit/language_test.rb
|
178
|
+
- test/dummy/tmp/cache/assets/CA2/BF0/sprockets%2Fb56ac30a59512f109e072c6c351195a8
|
179
|
+
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
180
|
+
- test/dummy/tmp/cache/assets/D2F/B50/sprockets%2Feb222894dcb95bae4f2a7e227222b006
|
181
|
+
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
182
|
+
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
183
|
+
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
184
|
+
- test/dummy/tmp/cache/assets/DAA/470/sprockets%2Fafb782256c9207973dfb6e63becb9b5c
|
185
|
+
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
186
|
+
- test/dummy/tmp/cache/assets/DEA/820/sprockets%2Fa3eb909f1fba592b6a225bc63abc1c2e
|
187
|
+
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
188
|
+
- test/dummy/tmp/capybara/capybara-201312171702124011360920.html
|
189
|
+
- test/dummy/tmp/capybara/capybara-201312171702595894767062.html
|
190
|
+
- test/dummy/tmp/capybara/capybara-201312171703428962416286.html
|
191
|
+
- test/dummy/tmp/capybara/capybara-201312171704117555796382.html
|
192
|
+
- test/dummy/tmp/capybara/capybara-201312172053002673059159.html
|
193
|
+
- test/dummy/tmp/capybara/capybara-201312172056035791412287.html
|
194
|
+
- test/dummy/tmp/capybara/capybara-201312172100198351601528.html
|
195
|
+
- test/dummy/tmp/capybara/capybara-201312172107323114657460.html
|
196
|
+
- test/dummy/tmp/capybara/capybara-201312172108211650964312.html
|
197
|
+
- test/dummy/tmp/capybara/capybara-20131217211129299664262.html
|
198
|
+
- test/dummy/tmp/capybara/capybara-201312172113193631383614.html
|
199
|
+
- test/dummy/tmp/capybara/capybara-201312172117421338188983.html
|
200
|
+
- test/form_select_options_test.rb
|
201
|
+
- test/i18n_form_helper_test.rb
|
202
|
+
- test/test_helper.rb
|
203
|
+
has_rdoc:
|