lazy-head-gen 0.4.3 → 0.5.0
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.
|
1
|
+
0.5.0
|
data/lazy-head-gen.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "lazy-head-gen"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Stuart Chinery"]
|
12
|
-
s.date = "2012-07-
|
12
|
+
s.date = "2012-07-25"
|
13
13
|
s.description = "lazy-head-gen adds some extra generators to Padrino. Currently they are hard wired to use ActiveRecord and MiniTest."
|
14
14
|
s.email = "stuart.chinery@headlondon.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/lazy-head-gen.rb
CHANGED
@@ -21,34 +21,8 @@ module LazyHeadGen
|
|
21
21
|
# and trys to view an admin page
|
22
22
|
#
|
23
23
|
def assert_admin_not_logged_in
|
24
|
-
assert !ok?
|
25
|
-
assert_equal 302, status
|
26
|
-
assert_equal "http://example.org/admin/sessions/new",
|
27
|
-
end
|
28
|
-
|
29
|
-
# Some shorthands for last_request and last_response varibles
|
30
|
-
#
|
31
|
-
def path
|
32
|
-
last_request.path
|
33
|
-
end
|
34
|
-
|
35
|
-
def session
|
36
|
-
last_request.env['rack.session']
|
37
|
-
end
|
38
|
-
|
39
|
-
def body
|
40
|
-
last_response.body
|
41
|
-
end
|
42
|
-
|
43
|
-
def status
|
44
|
-
last_response.status
|
45
|
-
end
|
46
|
-
|
47
|
-
def location
|
48
|
-
last_response.original_headers["Location"]
|
49
|
-
end
|
50
|
-
|
51
|
-
def ok?
|
52
|
-
last_response.ok?
|
24
|
+
assert !last_response.ok?
|
25
|
+
assert_equal 302, last_response.status
|
26
|
+
assert_equal "http://example.org/admin/sessions/new", last_response.original_headers["Location"]
|
53
27
|
end
|
54
28
|
end
|
@@ -103,8 +103,8 @@ describe "Admin::<%= @controller if @controller %>Controller" do
|
|
103
103
|
|
104
104
|
it "should display the <%= @pluralized %> index page" do
|
105
105
|
assert ok?
|
106
|
-
assert_equal 200, status
|
107
|
-
assert_equal "/admin/<%= @pluralized %>", path
|
106
|
+
assert_equal 200, last_response.status
|
107
|
+
assert_equal "/admin/<%= @pluralized %>", last_request.path
|
108
108
|
end
|
109
109
|
end
|
110
110
|
# END GET index
|
@@ -117,8 +117,8 @@ describe "Admin::<%= @controller if @controller %>Controller" do
|
|
117
117
|
|
118
118
|
it "should display the <%= @pluralized %> new page" do
|
119
119
|
assert ok?
|
120
|
-
assert_equal 200, status
|
121
|
-
assert_equal "/admin/<%= @pluralized
|
120
|
+
assert_equal 200, last_response.status
|
121
|
+
assert_equal "/admin/<%= @pluralized %>", last_request.path
|
122
122
|
end
|
123
123
|
end
|
124
124
|
# END GET new
|
@@ -132,7 +132,7 @@ describe "Admin::<%= @controller if @controller %>Controller" do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it "should redirect to the edit page" do
|
135
|
-
assert_equal 302, status
|
135
|
+
assert_equal 302, last_response.status
|
136
136
|
assert location.include?("/admin/<%= @pluralized %>/edit/#{<%= @model %>.last.to_param}")
|
137
137
|
end
|
138
138
|
|
@@ -151,8 +151,8 @@ describe "Admin::<%= @controller if @controller %>Controller" do
|
|
151
151
|
|
152
152
|
it "should display the <%= @pluralized %> edit page" do
|
153
153
|
assert ok?
|
154
|
-
assert_equal 200, status
|
155
|
-
assert_equal "/admin/<%= @pluralized %>/edit/#{@<%= @singular %>.to_param}", path
|
154
|
+
assert_equal 200, last_response.status
|
155
|
+
assert_equal "/admin/<%= @pluralized %>/edit/#{@<%= @singular %>.to_param}", last_request.path
|
156
156
|
end
|
157
157
|
end
|
158
158
|
# END GET edit
|
@@ -170,7 +170,7 @@ describe "Admin::<%= @controller if @controller %>Controller" do
|
|
170
170
|
end
|
171
171
|
|
172
172
|
it "should redirect to the edit page" do
|
173
|
-
assert_equal 302, status
|
173
|
+
assert_equal 302, last_response.status
|
174
174
|
assert location.include?("/admin/<%= @pluralized %>/edit/#{@<%= @singular %>.to_param}")
|
175
175
|
end
|
176
176
|
|
@@ -189,7 +189,7 @@ describe "Admin::<%= @controller if @controller %>Controller" do
|
|
189
189
|
end
|
190
190
|
|
191
191
|
it "should redirect to the index page" do
|
192
|
-
assert_equal 302, status
|
192
|
+
assert_equal 302, last_response.status
|
193
193
|
end
|
194
194
|
|
195
195
|
it "should destroy a <%= @singular %>" do
|
@@ -48,7 +48,7 @@ describe "<%= @controller if @controller %>Controller" do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should redirect to the show page" do
|
51
|
-
assert_equal 302, status
|
51
|
+
assert_equal 302, last_response.status
|
52
52
|
assert location.include?("/<%= @pluralized %>/show/")
|
53
53
|
end
|
54
54
|
|
@@ -81,7 +81,7 @@ describe "<%= @controller if @controller %>Controller" do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should redirect to the show page" do
|
84
|
-
assert_equal 302, status
|
84
|
+
assert_equal 302, last_response.status
|
85
85
|
assert location.include?("/<%= @pluralized %>/show/")
|
86
86
|
end
|
87
87
|
|
@@ -101,7 +101,7 @@ describe "<%= @controller if @controller %>Controller" do
|
|
101
101
|
end
|
102
102
|
|
103
103
|
it "should redirect to the index page" do
|
104
|
-
assert_equal 302, status
|
104
|
+
assert_equal 302, last_response.status
|
105
105
|
end
|
106
106
|
|
107
107
|
it "should delete the <%= @singular %>" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy-head-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stuart Chinery
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-25 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :runtime
|