rspec_rails_scaffold_templates 3.1.1 → 3.2.1

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: 60f8a6127b7c515cace39291ed0fcdffed531442fcc9888273295fae976cd8c2
4
- data.tar.gz: ad5710bb5ac8bae1283e922d4668bba99f44292731c34d21d758f2103fd67b5c
3
+ metadata.gz: 6b12b321c6dbfe9e69343dffd621425e8b59dd4732bd2bce9f24b5c35e398a3d
4
+ data.tar.gz: 534284aff760071514d6252c7a60045a0585bb21cb7e5456f14cf2ca9db41bfc
5
5
  SHA512:
6
- metadata.gz: b0156fc08c1111046004ea5699b52b4931fb87d6cde139792bbce4f6731a874c05d9c5f3aadd7eb4d490129b792d7ef1d08690efcc53b3f34d483dd5c76d78b8
7
- data.tar.gz: 6826bde0af17e066b2dede6726f98f29889cdf38a282a99e6649f9c3735ad61193f165d35afa15d15b133f42d0424e725a318d5aafce91eafd3de7adc1734bde
6
+ metadata.gz: d41c553c157a44a33baa6c9707ec05491e00110d6a3b8c6a5445a2e679ad88e93672ad1d69f28b15e53d645774d84247ec55a24fcff850ef76e88d887ac9cb37
7
+ data.tar.gz: 7d50a685719c41ac97b04796771d69189eb7de6c5bb95e5f54c49252ee2d51ec260d0377450c467d5da37fb8c0751e5595a6cedb5682d249c1b0eadfc00bc350
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ source "http://rubygems.org"
8
8
  group :development do
9
9
  gem "rspec", "~> 3.1"
10
10
  gem "rdoc", "~> 4.1"
11
- gem "bundler", "~> 1.6"
11
+ gem "bundler", "~> 2.3.9"
12
12
  gem "jeweler", "~> 2.0"
13
13
  gem "simplecov", "~> 0.0"
14
14
  end
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.license = "MIT"
20
20
  gem.summary = %Q{RSpec scaffold generator templates that use FactoryGirl and WiceGrid}
21
21
  gem.description = %Q{RSpec scaffold generator templates that use FactoryGirl and WiceGrid}
22
- gem.email = "dima@koulikoff.ru"
22
+ gem.email = "dima@koulikoff.de"
23
23
  gem.authors = ["Dmitri Koulikoff"]
24
24
  gem.version = File.exist?('VERSION') ? File.read('VERSION') : ""
25
25
  # dependencies defined in Gemfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.2.1
@@ -19,6 +19,9 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
19
19
  before :each do
20
20
  allow_any_instance_of(<%= controller_class_name %>Controller).to receive(:<%=method%>)
21
21
  .and_return(<%=method%>)
22
+ <% if options[:cancan] -%>
23
+ allow_any_instance_of(Ability).to receive(:can?).and_return true
24
+ <% end -%>
22
25
  end
23
26
 
24
27
  <% end -%>
@@ -72,7 +75,7 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
72
75
  <% end -%>
73
76
 
74
77
  describe "GET /show" do
75
- subject(:get_show) {get <%= show_helper.sub(/@([^)]+)/, 'id: \1.to_param') %>}
78
+ subject(:get_show) {get <%= file_name %>_url(id: <%= file_name %>.to_param)}
76
79
 
77
80
  it "renders a successful response" do
78
81
  <% unless factory_bot -%>
@@ -84,7 +87,7 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
84
87
  end
85
88
 
86
89
  describe "GET /new" do
87
- subject(:get_new) {get <%= new_helper %>}
90
+ subject(:get_new) {get new_<%= file_name %>_url}
88
91
 
89
92
  it "renders a successful response" do
90
93
  get_new
@@ -93,7 +96,7 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
93
96
  end
94
97
 
95
98
  describe "GET /edit" do
96
- subject(:get_edit) {get <%= edit_helper.sub(/@([^)]*)/, 'id: \1.to_param') %>}
99
+ subject(:get_edit) {get edit_<%= file_name %>_url(id: <%= file_name %>.to_param)}
97
100
 
98
101
  it "render a successful response" do
99
102
  <% unless factory_bot -%>
@@ -118,7 +121,7 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
118
121
 
119
122
  it "redirects to the created <%= ns_file_name %>" do
120
123
  post_create
121
- expect(response).to redirect_to(<%= show_helper.gsub("\@#{file_name}", 'id: ' + class_name + ".last.to_param") %>)
124
+ expect(response).to redirect_to <%= file_name %>_url <%= class_name %>.last.to_param
122
125
  end
123
126
  end
124
127
 
@@ -129,16 +132,21 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
129
132
  expect {post_create}.not_to change(<%= class_name %>, :count)
130
133
  end
131
134
 
132
- it "renders a successful response (i.e. to display the 'new' template)" do
135
+ it "returns an unprocessable_entity response" do
133
136
  post_create
134
- expect(response).to be_successful
137
+ expect(response).to have_http_status :unprocessable_entity
138
+ end
139
+
140
+ it "renders the 'new' template)" do
141
+ post_create
142
+ expect(response).to render_template :new
135
143
  end
136
144
  end
137
145
  end
138
146
 
139
147
  describe "PATCH /update" do
140
148
  subject(:patch_update) do
141
- patch <%= show_helper.sub(/@([^)]+)/, 'id: \1.to_param') %>, params: { <%= singular_table_name %>: attributes }
149
+ patch <%= file_name %>_url(id: <%= file_name %>.to_param), params: { <%= singular_table_name %>: attributes }
142
150
  end
143
151
 
144
152
  context "with valid parameters" do
@@ -169,18 +177,26 @@ describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %> do
169
177
  context "with invalid parameters" do
170
178
  let(:attributes) {invalid_attributes}
171
179
 
172
- it "renders a successful response (i.e. to display the 'edit' template)" do
180
+ it "returns an unprocessable_entity response" do
181
+ <% unless factory_bot -%>
182
+ <%= file_name %> = <%= class_name %>.create! valid_attributes
183
+ <% end -%>
184
+ patch_update
185
+ expect(response).to have_http_status :unprocessable_entity
186
+ end
187
+
188
+ it "renders the 'edit' template)" do
173
189
  <% unless factory_bot -%>
174
190
  <%= file_name %> = <%= class_name %>.create! valid_attributes
175
191
  <% end -%>
176
192
  patch_update
177
- expect(response).to be_successful
193
+ expect(response).to render_template :edit
178
194
  end
179
195
  end
180
196
  end
181
197
 
182
198
  describe "DELETE /destroy" do
183
- subject(:delete_destroy) {delete <%= show_helper.sub(/@([^)]+)/, 'id: \1.to_param') %>}
199
+ subject(:delete_destroy) {delete <%= file_name %>_url(id: <%= file_name %>.to_param)}
184
200
 
185
201
  it "destroys the requested <%= ns_file_name %>" do
186
202
  <% if factory_bot -%>
@@ -2,18 +2,18 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: rspec_rails_scaffold_templates 3.1.1 ruby lib
5
+ # stub: rspec_rails_scaffold_templates 3.2.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "rspec_rails_scaffold_templates".freeze
9
- s.version = "3.1.1"
9
+ s.version = "3.2.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Dmitri Koulikoff".freeze]
14
- s.date = "2020-07-17"
14
+ s.date = "2024-05-18"
15
15
  s.description = "RSpec scaffold generator templates that use FactoryGirl and WiceGrid".freeze
16
- s.email = "dima@koulikoff.ru".freeze
16
+ s.email = "dima@koulikoff.de".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
19
19
  "README.rdoc"
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  ]
44
44
  s.homepage = "http://github.com/dima4p/rspec_rails_scaffold_templates".freeze
45
45
  s.licenses = ["MIT".freeze]
46
- s.rubygems_version = "3.1.2".freeze
46
+ s.rubygems_version = "3.1.4".freeze
47
47
  s.summary = "RSpec scaffold generator templates that use FactoryGirl and WiceGrid".freeze
48
48
 
49
49
  if s.respond_to? :specification_version then
@@ -53,13 +53,13 @@ Gem::Specification.new do |s|
53
53
  if s.respond_to? :add_runtime_dependency then
54
54
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.1"])
55
55
  s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.1"])
56
- s.add_development_dependency(%q<bundler>.freeze, ["~> 1.6"])
56
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 2.3.9"])
57
57
  s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.0"])
58
58
  s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.0"])
59
59
  else
60
60
  s.add_dependency(%q<rspec>.freeze, ["~> 3.1"])
61
61
  s.add_dependency(%q<rdoc>.freeze, ["~> 4.1"])
62
- s.add_dependency(%q<bundler>.freeze, ["~> 1.6"])
62
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.3.9"])
63
63
  s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
64
64
  s.add_dependency(%q<simplecov>.freeze, ["~> 0.0"])
65
65
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_rails_scaffold_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitri Koulikoff
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-17 00:00:00.000000000 Z
11
+ date: 2024-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: 2.3.9
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: 2.3.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: jeweler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.0'
83
83
  description: RSpec scaffold generator templates that use FactoryGirl and WiceGrid
84
- email: dima@koulikoff.ru
84
+ email: dima@koulikoff.de
85
85
  executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files:
@@ -113,7 +113,7 @@ homepage: http://github.com/dima4p/rspec_rails_scaffold_templates
113
113
  licenses:
114
114
  - MIT
115
115
  metadata: {}
116
- post_install_message:
116
+ post_install_message:
117
117
  rdoc_options: []
118
118
  require_paths:
119
119
  - lib
@@ -128,8 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.1.2
132
- signing_key:
131
+ rubygems_version: 3.1.4
132
+ signing_key:
133
133
  specification_version: 4
134
134
  summary: RSpec scaffold generator templates that use FactoryGirl and WiceGrid
135
135
  test_files: []