eac_rails_utils 0.11.4 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/eac_rails_utils/common_form_helper.rb +6 -2
- data/lib/eac_rails_utils/version.rb +1 -1
- data/test/dummy/bin/rails +6 -0
- data/test/dummy/db/migrate/20160415125333_create_users.rb +3 -1
- data/test/dummy/db/migrate/20160415143123_create_jobs.rb +3 -1
- data/test/dummy/db/migrate/20160415143229_add_job_to_users.rb +3 -1
- metadata +18 -4
- data/test/helpers/eac_rails_utils/common_form_helper_test.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e74de3cf5f5df2ebc5dbf47d99ccf3adb446b60debbc0ae0ba4bdc0341b0702
|
4
|
+
data.tar.gz: 1fc1a3c6b2f1e28cca60ee396a69dcd682e739390c321c3b0ca6a4bb74aa19a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2227dab9cbab9704b6a227a29873c2d9db7de472cbe78e0546728ca171dff4b6e9af70b412b984ccfbf5c608bb501d03ba9ee23ac796877bf5759cd71bf542d
|
7
|
+
data.tar.gz: bc70bf917704e2c28f0d2a0fedeacdee1d09e48384f1ffd8fd5ed180b6d24ff77f1257c2081ea449999236c0a9a2c862e4f2897cc56904e036798489b6116476
|
@@ -1,10 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'action_view/helpers/form_helper'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
4
5
|
|
5
6
|
module EacRailsUtils
|
6
7
|
module CommonFormHelper
|
7
|
-
|
8
|
+
common_concern do
|
9
|
+
include ::ActionView::Helpers::FormHelper
|
10
|
+
end
|
11
|
+
require_sub __FILE__
|
8
12
|
|
9
13
|
def common_form(model_instance, options = {}, &block)
|
10
14
|
submit_label = options.delete(:submit_label)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_rails_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- E.A.C.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel-associations
|
@@ -128,6 +128,20 @@ dependencies:
|
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0.1'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rspec-rails
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
131
145
|
- !ruby/object:Gem::Dependency
|
132
146
|
name: sqlite3
|
133
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,6 +219,7 @@ files:
|
|
205
219
|
- test/dummy/app/assets/config/manifest.js
|
206
220
|
- test/dummy/app/models/job.rb
|
207
221
|
- test/dummy/app/models/user.rb
|
222
|
+
- test/dummy/bin/rails
|
208
223
|
- test/dummy/config.ru
|
209
224
|
- test/dummy/config/application.rb
|
210
225
|
- test/dummy/config/boot.rb
|
@@ -218,7 +233,6 @@ files:
|
|
218
233
|
- test/dummy/db/migrate/20160415143123_create_jobs.rb
|
219
234
|
- test/dummy/db/migrate/20160415143229_add_job_to_users.rb
|
220
235
|
- test/dummy/db/schema.rb
|
221
|
-
- test/helpers/eac_rails_utils/common_form_helper_test.rb
|
222
236
|
- test/helpers/eac_rails_utils/data_table_test_helper_test.rb
|
223
237
|
- test/helpers/eac_rails_utils/formatter_helper_test.rb
|
224
238
|
- test/lib/eac_rails_utils/models/attribute_required_test.rb
|
@@ -266,9 +280,9 @@ test_files:
|
|
266
280
|
- test/dummy/app/models/job.rb
|
267
281
|
- test/dummy/app/models/user.rb
|
268
282
|
- test/dummy/app/assets/config/manifest.js
|
283
|
+
- test/dummy/bin/rails
|
269
284
|
- test/test_helper.rb
|
270
285
|
- test/validators/cpf_validator_test.rb
|
271
|
-
- test/helpers/eac_rails_utils/common_form_helper_test.rb
|
272
286
|
- test/helpers/eac_rails_utils/data_table_test_helper_test.rb
|
273
287
|
- test/helpers/eac_rails_utils/formatter_helper_test.rb
|
274
288
|
- test/lib/eac_rails_utils/models/attribute_required_test.rb
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
module EacRailsUtils
|
6
|
-
class CommonFormHelperTest < ActionView::TestCase
|
7
|
-
include ::EacRailsUtils::CommonFormHelper
|
8
|
-
|
9
|
-
setup do
|
10
|
-
reset_test_database
|
11
|
-
end
|
12
|
-
|
13
|
-
test 'test common form' do
|
14
|
-
common_form(User.new) do |f|
|
15
|
-
f.text_field :name
|
16
|
-
f.email_field :email
|
17
|
-
f.password_field :password
|
18
|
-
f.searchable_association_field :job, url: search_jobs_path
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
test 'fields for' do
|
23
|
-
common_form(Job.new) do |f|
|
24
|
-
f.text_field :name
|
25
|
-
f.fields_for :users do |nf|
|
26
|
-
nf.text_field :name
|
27
|
-
nf.email_field :email
|
28
|
-
nf.password_field :password
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|