rspec_rails_scaffold_templates 1.2.0 → 1.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 574dccfbb1aa994597a59b926863f12c79cc50bf
|
4
|
+
data.tar.gz: 556bcf59ec0e2f1e422770eb570596641b91335a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f65db632c50e3248d3eb4555ab5968921e49e928a0046490301cf0545a3d27a78740b061c16fe922a8b489a2f41c23407e75522a6dd2374f91665e9741d2d9e
|
7
|
+
data.tar.gz: a06e96d81c18c2576d944071df4823b60756c3275a099799250be7174e86199d4069de57b709782514d4e60b1d47004765201cea4ff292c3edddf06025500f93
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
@@ -21,7 +21,7 @@ describe <%= controller_class_name %>Controller, type: :controller do
|
|
21
21
|
<% attribute_name = attribute.respond_to?(:column_name) ? attribute.column_name : attribute.name -%>
|
22
22
|
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_girl -%>
|
23
23
|
<% factory_girl = true -%>
|
24
|
-
let(:valid_attributes) {FactoryGirl.
|
24
|
+
let(:valid_attributes) {FactoryGirl.attributes_for(:<%=file_name%>).slice *%w[<%= attribute_name %>].map(&:to_sym)}
|
25
25
|
<% else -%>
|
26
26
|
<% factory_girl = false -%>
|
27
27
|
let(:valid_attributes) do
|
@@ -14,48 +14,31 @@ describe "<%= ns_table_name %>/index", type: :view do
|
|
14
14
|
# options[:fixture_replacement] == :factory_girl
|
15
15
|
<% end -%>
|
16
16
|
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_girl -%>
|
17
|
-
<% size = 1 -%>
|
18
17
|
@<%= ns_file_name %> = create(:<%= ns_file_name %>)
|
19
|
-
<%
|
20
|
-
|
21
|
-
<% size = 2 -%>
|
22
|
-
<% end -%>
|
23
|
-
<% else -%>
|
24
|
-
<% size = 2 -%>
|
25
|
-
<% if defined? Wice::WiceGrid -%>
|
26
|
-
result_set = assign(:<%= table_name %>, [
|
27
|
-
<% else -%>
|
28
|
-
assign(:<%= table_name %>, [
|
29
|
-
<% end -%>
|
30
|
-
# if you got an exception here add gem 'rspec-activemodel-mocks' to your Gemfile
|
31
|
-
<% [1,2].each_with_index do |id, model_index| -%>
|
32
|
-
<%= class_name %>.create(<%= output_attributes.empty? ? (model_index == 1 ? ')' : '),') : '' %>
|
18
|
+
<% else # no factory_girl -%>
|
19
|
+
<%= class_name %>.create(<%= output_attributes.empty? ? ')' : '' %>
|
33
20
|
<% output_attributes.each_with_index do |attribute, attribute_index| -%>
|
34
|
-
|
21
|
+
<%= attribute.name %>: <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
|
35
22
|
<% end -%>
|
36
23
|
<% if !output_attributes.empty? -%>
|
37
|
-
|
38
|
-
<% end -%>
|
24
|
+
)
|
39
25
|
<% end -%>
|
40
|
-
])
|
41
26
|
<% end -%>
|
27
|
+
assign :<%= table_name %>, <%= class_name %>.all
|
42
28
|
end
|
43
29
|
|
44
30
|
it "renders a list of <%= table_name %>" do
|
45
|
-
<% if defined? Wice::WiceGrid -%>
|
46
|
-
assign :<%= table_name %>, [@<%= ns_file_name %>]
|
47
|
-
<% end -%>
|
48
31
|
render
|
49
32
|
|
50
33
|
<% for attribute in output_attributes -%>
|
51
34
|
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_girl -%>
|
52
35
|
<% if attribute.reference? -%>
|
53
|
-
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.name, count:
|
36
|
+
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.name, count: 1
|
54
37
|
<% else -%>
|
55
|
-
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.to_s, count:
|
38
|
+
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.to_s, count: 1
|
56
39
|
<% end -%>
|
57
40
|
<% else -%>
|
58
|
-
assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count:
|
41
|
+
assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count: 1
|
59
42
|
<% end -%>
|
60
43
|
<% end -%>
|
61
44
|
end
|
@@ -68,12 +51,12 @@ describe "<%= ns_table_name %>/index", type: :view do
|
|
68
51
|
<% for attribute in output_attributes -%>
|
69
52
|
<% if Rails.application.config.generators.options[:rails][:fixture_replacement] == :factory_girl -%>
|
70
53
|
<% if attribute.reference? -%>
|
71
|
-
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.name, count:
|
54
|
+
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.name, count: 1
|
72
55
|
<% else -%>
|
73
|
-
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.to_s, count:
|
56
|
+
assert_select 'tr>td', text: @<%= ns_file_name %>.<%= attribute.name %>.to_s, count: 1
|
74
57
|
<% end -%>
|
75
58
|
<% else -%>
|
76
|
-
assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count:
|
59
|
+
assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count: 1
|
77
60
|
<% end -%>
|
78
61
|
<% end -%>
|
79
62
|
end
|
@@ -2,11 +2,11 @@
|
|
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 1.2.
|
5
|
+
# stub: rspec_rails_scaffold_templates 1.2.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rspec_rails_scaffold_templates"
|
9
|
-
s.version = "1.2.
|
9
|
+
s.version = "1.2.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|