dominium_stuff 0.0.1

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.
Files changed (84) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +22 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/javascripts/dominium/countries.js +2 -0
  5. data/app/assets/javascripts/dominium/states.js +2 -0
  6. data/app/assets/stylesheets/dominium/countries.css +4 -0
  7. data/app/assets/stylesheets/dominium/states.css +4 -0
  8. data/app/assets/stylesheets/scaffold.css +56 -0
  9. data/app/controllers/dominium/countries_controller.rb +65 -0
  10. data/app/controllers/dominium/states_controller.rb +64 -0
  11. data/app/helpers/dominium/countries_helper.rb +2 -0
  12. data/app/helpers/dominium/states_helper.rb +2 -0
  13. data/app/models/dominium.rb +5 -0
  14. data/app/models/dominium/country.rb +4 -0
  15. data/app/models/dominium/state.rb +6 -0
  16. data/app/views/dominium/countries/_form.html.erb +21 -0
  17. data/app/views/dominium/countries/edit.html.erb +6 -0
  18. data/app/views/dominium/countries/index.html.erb +23 -0
  19. data/app/views/dominium/countries/new.html.erb +5 -0
  20. data/app/views/dominium/countries/show.html.erb +10 -0
  21. data/app/views/dominium/states/_form.html.erb +29 -0
  22. data/app/views/dominium/states/edit.html.erb +6 -0
  23. data/app/views/dominium/states/index.html.erb +25 -0
  24. data/app/views/dominium/states/new.html.erb +5 -0
  25. data/app/views/dominium/states/show.html.erb +15 -0
  26. data/config/routes.rb +6 -0
  27. data/db/migrate/20111106194010_create_dominium_countries.rb +8 -0
  28. data/db/migrate/20111106222109_create_dominium_states.rb +9 -0
  29. data/lib/dominium_stuff.rb +4 -0
  30. data/lib/dominium_stuff/engine.rb +4 -0
  31. data/lib/dominium_stuff/version.rb +3 -0
  32. data/lib/tasks/dominium_stuff_tasks.rake +36 -0
  33. data/test/dominium_stuff_test.rb +7 -0
  34. data/test/dummy/Rakefile +7 -0
  35. data/test/dummy/app/assets/javascripts/application.js +9 -0
  36. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  37. data/test/dummy/app/controllers/application_controller.rb +3 -0
  38. data/test/dummy/app/helpers/application_helper.rb +2 -0
  39. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  40. data/test/dummy/config.ru +4 -0
  41. data/test/dummy/config/application.rb +45 -0
  42. data/test/dummy/config/boot.rb +10 -0
  43. data/test/dummy/config/database.yml +25 -0
  44. data/test/dummy/config/environment.rb +5 -0
  45. data/test/dummy/config/environments/development.rb +30 -0
  46. data/test/dummy/config/environments/production.rb +60 -0
  47. data/test/dummy/config/environments/test.rb +39 -0
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy/config/initializers/inflections.rb +10 -0
  50. data/test/dummy/config/initializers/mime_types.rb +5 -0
  51. data/test/dummy/config/initializers/secret_token.rb +7 -0
  52. data/test/dummy/config/initializers/session_store.rb +8 -0
  53. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  54. data/test/dummy/config/locales/en.yml +5 -0
  55. data/test/dummy/config/routes.rb +58 -0
  56. data/test/dummy/db/development.sqlite3 +0 -0
  57. data/test/dummy/db/schema.rb +28 -0
  58. data/test/dummy/db/test.sqlite3 +0 -0
  59. data/test/dummy/log/development.log +982 -0
  60. data/test/dummy/log/test.log +6019 -0
  61. data/test/dummy/public/404.html +26 -0
  62. data/test/dummy/public/422.html +26 -0
  63. data/test/dummy/public/500.html +26 -0
  64. data/test/dummy/public/favicon.ico +0 -0
  65. data/test/dummy/script/rails +6 -0
  66. data/test/dummy/tmp/cache/assets/CE9/860/sprockets%2F0adfc951841c8b269d1f46e6e8017934 +9068 -0
  67. data/test/dummy/tmp/cache/assets/D13/110/sprockets%2F11df2bbcd3b578a7196fa0699359043f +373 -0
  68. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  69. data/test/dummy/tmp/cache/assets/D43/DE0/sprockets%2Fcc857028c192ec2c22277f4ebb79dc09 +9052 -0
  70. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +10 -0
  71. data/test/dummy/tmp/cache/assets/D74/5A0/sprockets%2F6c0e9a7874a454d7b7abc6a8a283c5b7 +389 -0
  72. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +9427 -0
  73. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  74. data/test/fixtures/dominium/countries.yml +7 -0
  75. data/test/fixtures/dominium/states.yml +9 -0
  76. data/test/functional/dominium/countries_controller_test.rb +57 -0
  77. data/test/functional/dominium/states_controller_test.rb +63 -0
  78. data/test/integration/navigation_test.rb +10 -0
  79. data/test/test_helper.rb +10 -0
  80. data/test/unit/dominium/country_test.rb +24 -0
  81. data/test/unit/dominium/state_test.rb +27 -0
  82. data/test/unit/helpers/dominium/countries_helper_test.rb +4 -0
  83. data/test/unit/helpers/dominium/states_helper_test.rb +4 -0
  84. metadata +219 -0
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+ abbr: MyString
6
+
7
+ two:
8
+ name: MyString
9
+ abbr: MyString
@@ -0,0 +1,57 @@
1
+ require 'test_helper'
2
+
3
+ class Dominium::CountriesControllerTest < ActionController::TestCase
4
+ setup do
5
+ Dominium::Country.create valid_attributes
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:dominium_countries)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create dominium_country" do
20
+ assert_difference('Dominium::Country.count') do
21
+ post :create, dominium_country: valid_attributes.merge(name: 'Congo')
22
+ end
23
+
24
+ assert_redirected_to dominium_country_path(assigns(:dominium_country))
25
+ end
26
+
27
+ test "should show dominium_country" do
28
+ get :show, id: get_model.id
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: get_model.id
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update dominium_country" do
38
+ put :update, id: get_model.id, dominium_country: valid_attributes
39
+ assert_redirected_to dominium_country_path(assigns(:dominium_country))
40
+ end
41
+
42
+ test "should destroy dominium_country" do
43
+ assert_difference('Dominium::Country.count', -1) do
44
+ delete :destroy, id: get_model.id
45
+ end
46
+
47
+ assert_redirected_to dominium_countries_path
48
+ end
49
+
50
+ def get_model
51
+ Dominium::Country.first
52
+ end
53
+
54
+ def valid_attributes
55
+ {name: 'Brasil'}
56
+ end
57
+ end
@@ -0,0 +1,63 @@
1
+ #coding: utf-8
2
+ require 'test_helper'
3
+
4
+ class Dominium::StatesControllerTest < ActionController::TestCase
5
+ setup do
6
+ @country = Dominium::Country.create(name: 'Brasil')
7
+ @state = Dominium::State.create valid_attributes
8
+ end
9
+
10
+ test "should get index" do
11
+ get :index
12
+ assert_response :success
13
+ assert_not_nil assigns(:dominium_states)
14
+ end
15
+
16
+ test "should get new" do
17
+ get :new
18
+ assert_response :success
19
+ end
20
+
21
+ test "should create dominium_state" do
22
+ assert_difference('Dominium::State.count') do
23
+ post :create, dominium_state: valid_attributes
24
+ end
25
+
26
+ assert_redirected_to dominium_state_path(assigns(:dominium_state))
27
+ end
28
+
29
+ test "should show dominium_state" do
30
+ get :show, id: get_model.id
31
+ assert_response :success
32
+ end
33
+
34
+ test "should get edit" do
35
+ get :edit, id: get_model.id
36
+ assert_response :success
37
+ end
38
+
39
+ test "should update dominium_state" do
40
+ put :update, id: get_model.id, dominium_state: valid_attributes.merge(name: 'São Paulo')
41
+ assert_redirected_to dominium_state_path(assigns(:dominium_state))
42
+ end
43
+
44
+ test "should destroy dominium_state" do
45
+ assert_difference('Dominium::State.count', -1) do
46
+ delete :destroy, id: get_model.id
47
+ end
48
+
49
+ assert_redirected_to dominium_states_path
50
+ end
51
+
52
+ def get_model
53
+ Dominium::State.first
54
+ end
55
+
56
+ def valid_attributes
57
+ {
58
+ name: 'Sao Paulo',
59
+ abbr: 'SP',
60
+ country_id: Dominium::Country.first.id
61
+ }
62
+ end
63
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ # test "the truth" do
7
+ # assert true
8
+ # end
9
+ end
10
+
@@ -0,0 +1,10 @@
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
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+
3
+ class Dominium::CountryTest < ActiveSupport::TestCase
4
+ test "can't save invalid country(name min length" do
5
+ Dominium::Country.create(:name => 'tst') == false
6
+ end
7
+
8
+ test "can't save invalid country(name max length)" do
9
+ long_string = (1..256).to_a.to_s
10
+ Dominium::Country.create(:name => long_string) == false
11
+ end
12
+
13
+ test "save valid country" do
14
+ Dominium::Country.create(:name => 'Brasil') == true
15
+ end
16
+
17
+ test "uniqueness of coutry" do
18
+ Dominium::Country.create(:name => 'Brasil') == true
19
+ country = Dominium::Country.new(:name => 'Brasil')
20
+ country.save == false
21
+ country.errors.to_a.find('Name') == 'Name has already been taken'
22
+ end
23
+
24
+ end
@@ -0,0 +1,27 @@
1
+ #coding: utf-8
2
+ require 'test_helper'
3
+
4
+ class Dominium::StateTest < ActiveSupport::TestCase
5
+ setup do
6
+ Dominium::Country.create(name: 'Brasil')
7
+ end
8
+
9
+ test "save a valid state" do
10
+ assert Dominium::State.create(name: 'São Paulo', abbr: 'SP', country: Dominium::Country.find_by_name('Brasil'))
11
+ end
12
+
13
+ test "can't save with invalid country" do
14
+ Dominium::State.create(name: 'São Paulo', abbr: 'SP') == false
15
+ end
16
+
17
+ test "can't save with invalid name" do
18
+ Dominium::State.create(name: 'São', abbr: 'SP', country: Dominium::Country.find_by_name('Brasil')) == false
19
+
20
+ long_string = (1..256).to_a.to_s
21
+ Dominium::State.create(name: long_string, abbr: 'SP', country: Dominium::Country.find_by_name('Brasil')) == false
22
+ end
23
+
24
+ test "can't save with invalid abbr" do
25
+ Dominium::State.create(name: 'São Paulo', abbr: 'SP3', country: Dominium::Country.find_by_name('Brasil')) == false
26
+ end
27
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class Dominium::CountriesHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class Dominium::StatesHelperTest < ActionView::TestCase
4
+ end
metadata ADDED
@@ -0,0 +1,219 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dominium_stuff
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - vinicius gati
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-21 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &70263541745280 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70263541745280
25
+ - !ruby/object:Gem::Dependency
26
+ name: jquery-rails
27
+ requirement: &70263541744860 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70263541744860
36
+ - !ruby/object:Gem::Dependency
37
+ name: sqlite3
38
+ requirement: &70263541744360 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70263541744360
47
+ description: Creates a environment 'ready to play' with simple and common data inserted
48
+ with a simple rake task
49
+ email:
50
+ - viniciusgati@gmail.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - app/assets/javascripts/dominium/countries.js
56
+ - app/assets/javascripts/dominium/states.js
57
+ - app/assets/stylesheets/dominium/countries.css
58
+ - app/assets/stylesheets/dominium/states.css
59
+ - app/assets/stylesheets/scaffold.css
60
+ - app/controllers/dominium/countries_controller.rb
61
+ - app/controllers/dominium/states_controller.rb
62
+ - app/helpers/dominium/countries_helper.rb
63
+ - app/helpers/dominium/states_helper.rb
64
+ - app/models/dominium/country.rb
65
+ - app/models/dominium/state.rb
66
+ - app/models/dominium.rb
67
+ - app/views/dominium/countries/_form.html.erb
68
+ - app/views/dominium/countries/edit.html.erb
69
+ - app/views/dominium/countries/index.html.erb
70
+ - app/views/dominium/countries/new.html.erb
71
+ - app/views/dominium/countries/show.html.erb
72
+ - app/views/dominium/states/_form.html.erb
73
+ - app/views/dominium/states/edit.html.erb
74
+ - app/views/dominium/states/index.html.erb
75
+ - app/views/dominium/states/new.html.erb
76
+ - app/views/dominium/states/show.html.erb
77
+ - config/routes.rb
78
+ - db/migrate/20111106194010_create_dominium_countries.rb
79
+ - db/migrate/20111106222109_create_dominium_states.rb
80
+ - lib/dominium_stuff/engine.rb
81
+ - lib/dominium_stuff/version.rb
82
+ - lib/dominium_stuff.rb
83
+ - lib/tasks/dominium_stuff_tasks.rake
84
+ - MIT-LICENSE
85
+ - Rakefile
86
+ - README.rdoc
87
+ - test/dominium_stuff_test.rb
88
+ - test/dummy/app/assets/javascripts/application.js
89
+ - test/dummy/app/assets/stylesheets/application.css
90
+ - test/dummy/app/controllers/application_controller.rb
91
+ - test/dummy/app/helpers/application_helper.rb
92
+ - test/dummy/app/views/layouts/application.html.erb
93
+ - test/dummy/config/application.rb
94
+ - test/dummy/config/boot.rb
95
+ - test/dummy/config/database.yml
96
+ - test/dummy/config/environment.rb
97
+ - test/dummy/config/environments/development.rb
98
+ - test/dummy/config/environments/production.rb
99
+ - test/dummy/config/environments/test.rb
100
+ - test/dummy/config/initializers/backtrace_silencers.rb
101
+ - test/dummy/config/initializers/inflections.rb
102
+ - test/dummy/config/initializers/mime_types.rb
103
+ - test/dummy/config/initializers/secret_token.rb
104
+ - test/dummy/config/initializers/session_store.rb
105
+ - test/dummy/config/initializers/wrap_parameters.rb
106
+ - test/dummy/config/locales/en.yml
107
+ - test/dummy/config/routes.rb
108
+ - test/dummy/config.ru
109
+ - test/dummy/db/development.sqlite3
110
+ - test/dummy/db/schema.rb
111
+ - test/dummy/db/test.sqlite3
112
+ - test/dummy/log/development.log
113
+ - test/dummy/log/test.log
114
+ - test/dummy/public/404.html
115
+ - test/dummy/public/422.html
116
+ - test/dummy/public/500.html
117
+ - test/dummy/public/favicon.ico
118
+ - test/dummy/Rakefile
119
+ - test/dummy/script/rails
120
+ - test/dummy/tmp/cache/assets/CE9/860/sprockets%2F0adfc951841c8b269d1f46e6e8017934
121
+ - test/dummy/tmp/cache/assets/D13/110/sprockets%2F11df2bbcd3b578a7196fa0699359043f
122
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
123
+ - test/dummy/tmp/cache/assets/D43/DE0/sprockets%2Fcc857028c192ec2c22277f4ebb79dc09
124
+ - test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
125
+ - test/dummy/tmp/cache/assets/D74/5A0/sprockets%2F6c0e9a7874a454d7b7abc6a8a283c5b7
126
+ - test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
127
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
128
+ - test/fixtures/dominium/countries.yml
129
+ - test/fixtures/dominium/states.yml
130
+ - test/functional/dominium/countries_controller_test.rb
131
+ - test/functional/dominium/states_controller_test.rb
132
+ - test/integration/navigation_test.rb
133
+ - test/test_helper.rb
134
+ - test/unit/dominium/country_test.rb
135
+ - test/unit/dominium/state_test.rb
136
+ - test/unit/helpers/dominium/countries_helper_test.rb
137
+ - test/unit/helpers/dominium/states_helper_test.rb
138
+ homepage: http://github.com/viniciusgati
139
+ licenses: []
140
+ post_install_message:
141
+ rdoc_options: []
142
+ require_paths:
143
+ - lib
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ segments:
151
+ - 0
152
+ hash: 1680123787674793688
153
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ segments:
160
+ - 0
161
+ hash: 1680123787674793688
162
+ requirements: []
163
+ rubyforge_project:
164
+ rubygems_version: 1.8.10
165
+ signing_key:
166
+ specification_version: 3
167
+ summary: Engine for generating basic crud for simple and common data
168
+ test_files:
169
+ - test/dominium_stuff_test.rb
170
+ - test/dummy/app/assets/javascripts/application.js
171
+ - test/dummy/app/assets/stylesheets/application.css
172
+ - test/dummy/app/controllers/application_controller.rb
173
+ - test/dummy/app/helpers/application_helper.rb
174
+ - test/dummy/app/views/layouts/application.html.erb
175
+ - test/dummy/config/application.rb
176
+ - test/dummy/config/boot.rb
177
+ - test/dummy/config/database.yml
178
+ - test/dummy/config/environment.rb
179
+ - test/dummy/config/environments/development.rb
180
+ - test/dummy/config/environments/production.rb
181
+ - test/dummy/config/environments/test.rb
182
+ - test/dummy/config/initializers/backtrace_silencers.rb
183
+ - test/dummy/config/initializers/inflections.rb
184
+ - test/dummy/config/initializers/mime_types.rb
185
+ - test/dummy/config/initializers/secret_token.rb
186
+ - test/dummy/config/initializers/session_store.rb
187
+ - test/dummy/config/initializers/wrap_parameters.rb
188
+ - test/dummy/config/locales/en.yml
189
+ - test/dummy/config/routes.rb
190
+ - test/dummy/config.ru
191
+ - test/dummy/db/development.sqlite3
192
+ - test/dummy/db/schema.rb
193
+ - test/dummy/db/test.sqlite3
194
+ - test/dummy/log/development.log
195
+ - test/dummy/log/test.log
196
+ - test/dummy/public/404.html
197
+ - test/dummy/public/422.html
198
+ - test/dummy/public/500.html
199
+ - test/dummy/public/favicon.ico
200
+ - test/dummy/Rakefile
201
+ - test/dummy/script/rails
202
+ - test/dummy/tmp/cache/assets/CE9/860/sprockets%2F0adfc951841c8b269d1f46e6e8017934
203
+ - test/dummy/tmp/cache/assets/D13/110/sprockets%2F11df2bbcd3b578a7196fa0699359043f
204
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
205
+ - test/dummy/tmp/cache/assets/D43/DE0/sprockets%2Fcc857028c192ec2c22277f4ebb79dc09
206
+ - test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
207
+ - test/dummy/tmp/cache/assets/D74/5A0/sprockets%2F6c0e9a7874a454d7b7abc6a8a283c5b7
208
+ - test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
209
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
210
+ - test/fixtures/dominium/countries.yml
211
+ - test/fixtures/dominium/states.yml
212
+ - test/functional/dominium/countries_controller_test.rb
213
+ - test/functional/dominium/states_controller_test.rb
214
+ - test/integration/navigation_test.rb
215
+ - test/test_helper.rb
216
+ - test/unit/dominium/country_test.rb
217
+ - test/unit/dominium/state_test.rb
218
+ - test/unit/helpers/dominium/countries_helper_test.rb
219
+ - test/unit/helpers/dominium/states_helper_test.rb