eac_active_scaffold 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0afe61c33b10658e4cc09606b154fbec009e7aa2869dccaa847d688d55c1998f
4
- data.tar.gz: 2b340b542c9b00657c956c16ea10bab6ee5ecd61bb45cde15272a77aaa6a9451
3
+ metadata.gz: 650d52ff598ef2934d32a33e997708b4922adcb148b73a752c5e792a1db7d1fd
4
+ data.tar.gz: b2f8f18f0b30bbe852ae2cadd303e769476282f8249dae255c65c36a147795e9
5
5
  SHA512:
6
- metadata.gz: 2680e6c170109dad1a75e92deeff177d5426090236b10dd65d01ee55fc5d35bc080a063d1a592000aadc6833a8cafc95893a51a086ffbf9711de0efbbbc8a8a7
7
- data.tar.gz: b44620f387eaf697ccaac0739cc1fec9bf73f7052e732961078f75ad32b75b9736d1ecbeb0f8b665880a5f8914fa29a7cbc125be81cd872ab75ca6eef6e170da
6
+ metadata.gz: 634d7090f292491899e831ac3e66bacd1d0c069aad0a040445fcfb99698ff42015c2cd445e725acd8626bdfd42a3d6a528d8eac0c420fc1eaec93a7790f2b801
7
+ data.tar.gz: b49da51f5b2128f4a737191cfd0373c7c1dd68fdfd6608868de644119c0562392c0f09e78c5afd38e2c241b7d1d15cd489e164cb75df221812717b5e135d30d3
@@ -19,6 +19,6 @@ module EacActiveScaffold
19
19
  end
20
20
 
21
21
  require 'action_dispatch/routing/mapper'
22
- ::ActionDispatch::Routing::Mapper.include(
23
- ::EacActiveScaffold::Patches::ActionDispatch
22
+ ActionDispatch::Routing::Mapper.include(
23
+ EacActiveScaffold::Patches::ActionDispatch
24
24
  )
@@ -24,6 +24,11 @@ module EacActiveScaffold
24
24
  attrs.each { |attr, value| attribute_set(example, attr, value) }
25
25
  end
26
26
 
27
+ # @return [Boolean]
28
+ def create?
29
+ valid_create_data.present?
30
+ end
31
+
27
32
  # @return [Class]
28
33
  def controller_class
29
34
  options[:controller_class] || example.described_class
@@ -51,7 +56,7 @@ module EacActiveScaffold
51
56
 
52
57
  # @return [Hash]
53
58
  def valid_data
54
- options.fetch(OPTION_VALID_DATA)
59
+ options[OPTION_VALID_DATA]
55
60
  end
56
61
 
57
62
  # @return [Hash]
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'eac_active_scaffold/rspec/controller_director'
4
4
 
5
- ::RSpec.shared_context 'active_scaffold_controller' do |options| # rubocop:disable Metrics/BlockLength
6
- director = ::EacActiveScaffold::Rspec::ControllerDirector.new(self, options)
5
+ RSpec.shared_context 'active_scaffold_controller' do |options| # rubocop:disable Metrics/BlockLength
6
+ director = EacActiveScaffold::Rspec::ControllerDirector.new(self, options)
7
7
 
8
8
  before do
9
9
  visit director.index_path
@@ -13,19 +13,21 @@ require 'eac_active_scaffold/rspec/controller_director'
13
13
  expect(page).to have_content director.page_title
14
14
  end
15
15
 
16
+ next unless director.create?
17
+
16
18
  context 'when record is created' do # rubocop:disable Metrics/BlockLength
17
19
  let(:before_create_count) { director.model_class.count }
18
20
  let(:created_record) { director.model_class.first }
19
- let(:record_href) { %r{/#{::Regexp.quote(created_record.id.to_s)}} }
20
- let(:edit_link_args) { [::I18n.t('active_scaffold.edit'), href: record_href] }
21
- let(:remove_link_args) { [::I18n.t('active_scaffold.remove'), href: record_href] }
22
- let(:show_link_args) { [::I18n.t('active_scaffold.show'), href: record_href] }
21
+ let(:record_href) { %r{/#{Regexp.quote(created_record.id.to_s)}} }
22
+ let(:edit_link_args) { [I18n.t('active_scaffold.edit'), { href: record_href }] }
23
+ let(:remove_link_args) { [I18n.t('active_scaffold.remove'), { href: record_href }] }
24
+ let(:show_link_args) { [I18n.t('active_scaffold.show'), { href: record_href }] }
23
25
 
24
26
  before do
25
27
  before_create_count
26
- click_on ::I18n.t('active_scaffold.create_new')
28
+ click_on I18n.t('active_scaffold.create_new')
27
29
  director.attributes_set(self, director.valid_create_data)
28
- click_on ::I18n.t('active_scaffold.create')
30
+ click_on I18n.t('active_scaffold.create')
29
31
  end
30
32
 
31
33
  it 'increments record count' do
@@ -51,7 +53,7 @@ require 'eac_active_scaffold/rspec/controller_director'
51
53
  before_update_count
52
54
  click_link(*edit_link_args)
53
55
  director.attributes_set(self, director.valid_update_data)
54
- click_on ::I18n.t('active_scaffold.update')
56
+ click_on I18n.t('active_scaffold.update')
55
57
  end
56
58
 
57
59
  it 'unchanges record count' do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacActiveScaffold
4
- VERSION = '0.5.1'
4
+ VERSION = '0.5.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2024-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_scaffold
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3.6'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.6.19
22
+ version: 3.6.20
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,47 +29,35 @@ dependencies:
29
29
  version: '3.6'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.6.19
32
+ version: 3.6.20
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: eac_ruby_utils
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.117'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.117.1
39
+ version: '0.120'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
44
  - - "~>"
48
45
  - !ruby/object:Gem::Version
49
- version: '0.117'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.117.1
46
+ version: '0.120'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: eac_rails_gem_support
55
49
  requirement: !ruby/object:Gem::Requirement
56
50
  requirements:
57
51
  - - "~>"
58
52
  - !ruby/object:Gem::Version
59
- version: '0.4'
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 0.4.1
53
+ version: 0.9.1
63
54
  type: :development
64
55
  prerelease: false
65
56
  version_requirements: !ruby/object:Gem::Requirement
66
57
  requirements:
67
58
  - - "~>"
68
59
  - !ruby/object:Gem::Version
69
- version: '0.4'
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: 0.4.1
60
+ version: 0.9.1
73
61
  description:
74
62
  email:
75
63
  executables: []
@@ -99,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
87
  requirements:
100
88
  - - ">="
101
89
  - !ruby/object:Gem::Version
102
- version: '0'
90
+ version: '2.7'
103
91
  required_rubygems_version: !ruby/object:Gem::Requirement
104
92
  requirements:
105
93
  - - ">="