rspec_rails_scaffold_templates 2.2.1 → 2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/api_controller_spec.rb +5 -5
- data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/controller_spec.rb +5 -5
- data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/edit_spec.rb +4 -4
- data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/index_spec.rb +8 -6
- data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/new_spec.rb +4 -4
- data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/show_spec.rb +2 -2
- data/rspec_rails_scaffold_templates.gemspec +28 -28
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ad10fd3f93fc8e6f8bc9fc57b2558e33ec8f37fdbdcb031d303d1aed0ba1d7b0
|
4
|
+
data.tar.gz: 83117df7955ca4577567cf6c996c8ad14de395d9cdd0df1b6382a644b923a156
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 621656d22d2a62138abb3879dd144d66c87893836bbf921e0f50e2488dc1a487d65a720a61825688334c9dbe64ffe9b50c56e691ade7ea5965df80e022b6be55
|
7
|
+
data.tar.gz: 48e92b04edce2e1f538d6b754091b6d601af28e5ce50a21deccccc2a91f2f70abeae4368bd3a9408f9f41e42373e60e58eae5fab5234b7f7a995d3b521c00f0e
|
data/Rakefile
CHANGED
@@ -21,6 +21,7 @@ Jeweler::Tasks.new do |gem|
|
|
21
21
|
gem.description = %Q{RSpec scaffold generator templates that use FactoryGirl and WiceGrid}
|
22
22
|
gem.email = "dima@koulikoff.ru"
|
23
23
|
gem.authors = ["Dmitri Koulikoff"]
|
24
|
+
gem.version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
24
25
|
# dependencies defined in Gemfile
|
25
26
|
end
|
26
27
|
Jeweler::RubygemsDotOrgTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3
|
data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/api_controller_spec.rb
CHANGED
@@ -19,13 +19,13 @@ describe Api::<%= options[:api_version].camelcase + '::' if options[:api_version
|
|
19
19
|
<% links = attributes.select{|a| [:belongs_to, :references].include? a.type} -%>
|
20
20
|
<% attribute = (attributes - links).detect{|a| a.name == 'name' || a.name == 'title' || a.name == 'code' || a.name =~ /name/ || a.name =~ /title/} || attributes.first -%>
|
21
21
|
<% attribute_name = attribute.respond_to?(:column_name) ? attribute.column_name : attribute.name -%>
|
22
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
23
|
-
<%
|
22
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
23
|
+
<% factory_bot = true -%>
|
24
24
|
let(:<%= file_name %>) {create :<%= file_name %>}
|
25
25
|
|
26
26
|
<% if links.present? -%>
|
27
27
|
let(:valid_attributes) do
|
28
|
-
|
28
|
+
attributes_for(:<%=file_name%>)
|
29
29
|
.slice(*%w[<%= attribute_name %>].map(&:to_sym))
|
30
30
|
.merge(
|
31
31
|
<% links.each do |relation| -%>
|
@@ -34,10 +34,10 @@ describe Api::<%= options[:api_version].camelcase + '::' if options[:api_version
|
|
34
34
|
)
|
35
35
|
end
|
36
36
|
<% else -%>
|
37
|
-
let(:valid_attributes) {
|
37
|
+
let(:valid_attributes) {attributes_for(:<%=file_name%>).slice *%w[<%= attribute_name %>].map(&:to_sym)}
|
38
38
|
<% end -%>
|
39
39
|
<% else -%>
|
40
|
-
<%
|
40
|
+
<% factory_bot = false -%>
|
41
41
|
let(:<%= file_name %>) {<%= class_name %>.create! valid_attributes}
|
42
42
|
|
43
43
|
let(:valid_attributes) do
|
data/lib/rspec_rails_scaffold_templates/generators/templates/rspec/scaffold/controller_spec.rb
CHANGED
@@ -19,13 +19,13 @@ describe <%= controller_class_name %>Controller, <%= type_metatag(:controller) %
|
|
19
19
|
<% links = attributes.select{|a| [:belongs_to, :references].include? a.type} -%>
|
20
20
|
<% attribute = (attributes - links).detect{|a| a.name == 'name' || a.name == 'title' || a.name == 'code' || a.name =~ /name/ || a.name =~ /title/} || attributes.first -%>
|
21
21
|
<% attribute_name = attribute.respond_to?(:column_name) ? attribute.column_name : attribute.name -%>
|
22
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
23
|
-
<%
|
22
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
23
|
+
<% factory_bot = true -%>
|
24
24
|
let(:<%= file_name %>) {create :<%= file_name %>}
|
25
25
|
|
26
26
|
<% if links.present? -%>
|
27
27
|
let(:valid_attributes) do
|
28
|
-
|
28
|
+
attributes_for(:<%=file_name%>)
|
29
29
|
.slice(*%w[<%= attribute_name %>].map(&:to_sym))
|
30
30
|
.merge(
|
31
31
|
<% links.each do |relation| -%>
|
@@ -34,10 +34,10 @@ describe <%= controller_class_name %>Controller, <%= type_metatag(:controller) %
|
|
34
34
|
)
|
35
35
|
end
|
36
36
|
<% else -%>
|
37
|
-
let(:valid_attributes) {
|
37
|
+
let(:valid_attributes) {attributes_for(:<%=file_name%>).slice *%w[<%= attribute_name %>].map(&:to_sym)}
|
38
38
|
<% end -%>
|
39
39
|
<% else -%>
|
40
|
-
<%
|
40
|
+
<% factory_bot = false -%>
|
41
41
|
let(:<%= file_name %>) {<%= class_name %>.create! valid_attributes}
|
42
42
|
|
43
43
|
let(:valid_attributes) do
|
@@ -3,15 +3,15 @@ require 'rails_helper'
|
|
3
3
|
<% else -%>
|
4
4
|
require 'spec_helper'
|
5
5
|
<% end -%>
|
6
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
7
|
-
<%
|
6
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
7
|
+
<% factory_bot = true -%>
|
8
8
|
<% else -%>
|
9
|
-
<%
|
9
|
+
<% factory_bot = false -%>
|
10
10
|
<% end -%>
|
11
11
|
|
12
12
|
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
|
13
13
|
describe "<%= ns_table_name %>/edit", <%= type_metatag(:view) %> do
|
14
|
-
<% if
|
14
|
+
<% if factory_bot -%>
|
15
15
|
let(:<%= ns_file_name %>) {create :<%= ns_file_name %>}
|
16
16
|
<% else -%>
|
17
17
|
let(:<%= ns_file_name %>) do
|
@@ -3,15 +3,15 @@ require 'rails_helper'
|
|
3
3
|
<% else -%>
|
4
4
|
require 'spec_helper'
|
5
5
|
<% end -%>
|
6
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
7
|
-
<%
|
6
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
7
|
+
<% factory_bot = true -%>
|
8
8
|
<% else -%>
|
9
|
-
<%
|
9
|
+
<% factory_bot = false -%>
|
10
10
|
<% end -%>
|
11
11
|
|
12
12
|
<% output_attributes = attributes.reject{|attribute| [:created_at, :deleted_at, :updated_at].index(attribute.name) or attribute.password_digest? } -%>
|
13
13
|
describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
|
14
|
-
<% if
|
14
|
+
<% if factory_bot -%>
|
15
15
|
let!(:<%= ns_file_name %>) {create :<%= ns_file_name %>}
|
16
16
|
<% else -%>
|
17
17
|
let!(:<%= ns_file_name %>) do
|
@@ -27,6 +27,8 @@ describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
|
|
27
27
|
<% if Rails.application.config.generators.options[:rails][:cancan] -%>
|
28
28
|
allow(controller).to receive(:can?).and_return(true)
|
29
29
|
<% end -%>
|
30
|
+
allow(controller).to receive(:params)
|
31
|
+
.and_return(ActionController::Parameters.new({}))
|
30
32
|
assign :<%= table_name %>, <%= class_name %>.all
|
31
33
|
end
|
32
34
|
|
@@ -34,7 +36,7 @@ describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
|
|
34
36
|
render
|
35
37
|
|
36
38
|
<% for attribute in output_attributes -%>
|
37
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
39
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
38
40
|
<% if attribute.reference? -%>
|
39
41
|
assert_select 'tr>td', text: <%= ns_file_name %>.<%= attribute.name %>.name, count: 1
|
40
42
|
<% else -%>
|
@@ -52,7 +54,7 @@ describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
|
|
52
54
|
render
|
53
55
|
|
54
56
|
<% for attribute in output_attributes -%>
|
55
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
57
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
56
58
|
<% if attribute.reference? -%>
|
57
59
|
assert_select 'tr>td', text: <%= ns_file_name %>.<%= attribute.name %>.name, count: 1
|
58
60
|
<% else -%>
|
@@ -3,15 +3,15 @@ require 'rails_helper'
|
|
3
3
|
<% else -%>
|
4
4
|
require 'spec_helper'
|
5
5
|
<% end -%>
|
6
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
7
|
-
<%
|
6
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
7
|
+
<% factory_bot = true -%>
|
8
8
|
<% else -%>
|
9
|
-
<%
|
9
|
+
<% factory_bot = false -%>
|
10
10
|
<% end -%>
|
11
11
|
|
12
12
|
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
|
13
13
|
describe "<%= ns_table_name %>/new", <%= type_metatag(:view) %> do
|
14
|
-
<% if
|
14
|
+
<% if factory_bot -%>
|
15
15
|
let(:<%= ns_file_name %>) {build :<%= ns_file_name %>}
|
16
16
|
<% else -%>
|
17
17
|
let(:<%= ns_file_name %>) do
|
@@ -6,7 +6,7 @@ require 'spec_helper'
|
|
6
6
|
|
7
7
|
<% output_attributes = attributes.reject{|attribute| [:created_at, :deleted_at, :updated_at].index(attribute.name) or attribute.password_digest? } -%>
|
8
8
|
describe "<%= ns_table_name %>/show", <%= type_metatag(:view) %> do
|
9
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
9
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
10
10
|
let(:<%= ns_file_name %>) {create :<%= ns_file_name %>}
|
11
11
|
<% else -%>
|
12
12
|
let(:<%= ns_file_name %>) do
|
@@ -30,7 +30,7 @@ describe "<%= ns_table_name %>/show", <%= type_metatag(:view) %> do
|
|
30
30
|
it "renders attributes in dl>dd" do
|
31
31
|
render
|
32
32
|
<% for attribute in output_attributes -%>
|
33
|
-
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :
|
33
|
+
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_bot -%>
|
34
34
|
<% if attribute.reference? -%>
|
35
35
|
assert_select 'dl>dd', text: Regexp.new(<%= ns_file_name %>.<%= attribute.name %>.name)
|
36
36
|
<% else -%>
|
@@ -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 2.
|
5
|
+
# stub: rspec_rails_scaffold_templates 2.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "rspec_rails_scaffold_templates"
|
9
|
-
s.version = "2.
|
8
|
+
s.name = "rspec_rails_scaffold_templates".freeze
|
9
|
+
s.version = "2.3"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["Dmitri Koulikoff"]
|
14
|
-
s.date = "
|
15
|
-
s.description = "RSpec scaffold generator templates that use FactoryGirl and WiceGrid"
|
16
|
-
s.email = "dima@koulikoff.ru"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Dmitri Koulikoff".freeze]
|
14
|
+
s.date = "2019-05-22"
|
15
|
+
s.description = "RSpec scaffold generator templates that use FactoryGirl and WiceGrid".freeze
|
16
|
+
s.email = "dima@koulikoff.ru".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.rdoc"
|
@@ -40,33 +40,33 @@ Gem::Specification.new do |s|
|
|
40
40
|
"spec/rspec_rails_scaffold_templates_spec.rb",
|
41
41
|
"spec/spec_helper.rb"
|
42
42
|
]
|
43
|
-
s.homepage = "http://github.com/dima4p/rspec_rails_scaffold_templates"
|
44
|
-
s.licenses = ["MIT"]
|
45
|
-
s.rubygems_version = "
|
46
|
-
s.summary = "RSpec scaffold generator templates that use FactoryGirl and WiceGrid"
|
43
|
+
s.homepage = "http://github.com/dima4p/rspec_rails_scaffold_templates".freeze
|
44
|
+
s.licenses = ["MIT".freeze]
|
45
|
+
s.rubygems_version = "3.0.3".freeze
|
46
|
+
s.summary = "RSpec scaffold generator templates that use FactoryGirl and WiceGrid".freeze
|
47
47
|
|
48
48
|
if s.respond_to? :specification_version then
|
49
49
|
s.specification_version = 4
|
50
50
|
|
51
51
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
-
s.add_development_dependency(%q<rspec
|
53
|
-
s.add_development_dependency(%q<rdoc
|
54
|
-
s.add_development_dependency(%q<bundler
|
55
|
-
s.add_development_dependency(%q<jeweler
|
56
|
-
s.add_development_dependency(%q<simplecov
|
52
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.1"])
|
53
|
+
s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.1"])
|
54
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 1.6"])
|
55
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.0"])
|
56
|
+
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.0"])
|
57
57
|
else
|
58
|
-
s.add_dependency(%q<rspec
|
59
|
-
s.add_dependency(%q<rdoc
|
60
|
-
s.add_dependency(%q<bundler
|
61
|
-
s.add_dependency(%q<jeweler
|
62
|
-
s.add_dependency(%q<simplecov
|
58
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.1"])
|
59
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 4.1"])
|
60
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1.6"])
|
61
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
|
62
|
+
s.add_dependency(%q<simplecov>.freeze, ["~> 0.0"])
|
63
63
|
end
|
64
64
|
else
|
65
|
-
s.add_dependency(%q<rspec
|
66
|
-
s.add_dependency(%q<rdoc
|
67
|
-
s.add_dependency(%q<bundler
|
68
|
-
s.add_dependency(%q<jeweler
|
69
|
-
s.add_dependency(%q<simplecov
|
65
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.1"])
|
66
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 4.1"])
|
67
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1.6"])
|
68
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
|
69
|
+
s.add_dependency(%q<simplecov>.freeze, ["~> 0.0"])
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
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: 2.
|
4
|
+
version: '2.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitri Koulikoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -127,8 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
|
131
|
-
rubygems_version: 2.5.1
|
130
|
+
rubygems_version: 3.0.3
|
132
131
|
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: RSpec scaffold generator templates that use FactoryGirl and WiceGrid
|