jzajpt-blueberry_scaffold 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/blueberry_scaffold.gemspec
CHANGED
@@ -17,6 +17,10 @@ class <%= controller_test_name %> < ActionController::TestCase
|
|
17
17
|
should "return 5 items" do
|
18
18
|
assert_equal 5, assigns(:<%= plural_name %>).size
|
19
19
|
end
|
20
|
+
|
21
|
+
should "display <%= plural_name %> table with 5 items" do
|
22
|
+
assert_select "table.list > tbody > tr", 5
|
23
|
+
end
|
20
24
|
end
|
21
25
|
|
22
26
|
<% end -%>
|
@@ -67,9 +71,14 @@ class <%= controller_test_name %> < ActionController::TestCase
|
|
67
71
|
<% end -%>
|
68
72
|
<% if action? :create -%>
|
69
73
|
context "on POST to #create" do
|
74
|
+
setup do
|
75
|
+
@<%= singular_name %> = Factory.build :<%= singular_name %>
|
76
|
+
<%= class_name %>.stubs(:new).with(anything).returns(@<%= singular_name %>)
|
77
|
+
end
|
78
|
+
|
70
79
|
context "with valid attributes" do
|
71
80
|
setup do
|
72
|
-
<%= class_name %>.any_instance.stubs(:
|
81
|
+
<%= class_name %>.any_instance.stubs(:save!).returns(true)
|
73
82
|
post :create
|
74
83
|
end
|
75
84
|
|
@@ -100,11 +109,14 @@ class <%= controller_test_name %> < ActionController::TestCase
|
|
100
109
|
<% end -%>
|
101
110
|
<% if action? :update -%>
|
102
111
|
context "on PUT to #update" do
|
103
|
-
setup
|
112
|
+
setup do
|
113
|
+
@<%= singular_name %> = Factory.build :<%= singular_name %>, :id => 1
|
114
|
+
<%= class_name %>.stubs(:find).with(anything).returns(@<%= singular_name %>)
|
115
|
+
end
|
104
116
|
|
105
117
|
context "with valid attributes" do
|
106
118
|
setup do
|
107
|
-
<%= class_name %>.any_instance.stubs(:
|
119
|
+
<%= class_name %>.any_instance.stubs(:update_attributes!).returns(true)
|
108
120
|
put :update, :id => @<%= singular_name %>.id
|
109
121
|
end
|
110
122
|
|