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.0
1
+ 0.3.1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{blueberry_scaffold}
5
- s.version = "0.3.0"
5
+ s.version = "0.3.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ji\305\231\303\255 Zajpt"]
@@ -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(:valid?).returns(true)
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 { @<%= singular_name %> = Factory :<%= singular_name %> }
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(:valid?).returns(true)
119
+ <%= class_name %>.any_instance.stubs(:update_attributes!).returns(true)
108
120
  put :update, :id => @<%= singular_name %>.id
109
121
  end
110
122
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jzajpt-blueberry_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Ji\xC5\x99\xC3\xAD Zajpt"