merb-admin 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/Rakefile +1 -1
- data/app/views/main/_text.html.erb +1 -1
- data/lib/merb-admin.rb +1 -1
- data/spec/requests/main_spec.rb +28 -13
- metadata +1 -1
data/README.markdown
CHANGED
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ AUTHOR = "Erik Michaels-Ober"
|
|
9
9
|
EMAIL = "sferik@gmail.com"
|
10
10
|
HOMEPAGE = "http://twitter.com/sferik"
|
11
11
|
SUMMARY = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
|
12
|
-
GEM_VERSION = "0.4.
|
12
|
+
GEM_VERSION = "0.4.8"
|
13
13
|
|
14
14
|
spec = Gem::Specification.new do |s|
|
15
15
|
s.rubyforge_project = "merb"
|
data/lib/merb-admin.rb
CHANGED
@@ -23,7 +23,7 @@ if defined?(Merb::Plugins)
|
|
23
23
|
|
24
24
|
# Slice metadata
|
25
25
|
self.description = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
|
26
|
-
self.version = "0.4.
|
26
|
+
self.version = "0.4.8"
|
27
27
|
self.author = "Erik Michaels-Ober"
|
28
28
|
|
29
29
|
# Stub classes loaded hook - runs before LoadClasses BootLoader
|
data/spec/requests/main_spec.rb
CHANGED
@@ -70,7 +70,7 @@ describe "MerbAdmin" do
|
|
70
70
|
@response.should be_successful
|
71
71
|
end
|
72
72
|
|
73
|
-
it "should
|
73
|
+
it "should show \"Site administration\"" do
|
74
74
|
@response.body.should contain("Site administration")
|
75
75
|
end
|
76
76
|
end
|
@@ -84,7 +84,7 @@ describe "MerbAdmin" do
|
|
84
84
|
@response.should be_successful
|
85
85
|
end
|
86
86
|
|
87
|
-
it "should
|
87
|
+
it "should show \"Select model to edit\"" do
|
88
88
|
@response.body.should contain("Select player to edit")
|
89
89
|
end
|
90
90
|
end
|
@@ -132,7 +132,7 @@ describe "MerbAdmin" do
|
|
132
132
|
@response.should be_successful
|
133
133
|
end
|
134
134
|
|
135
|
-
it "should
|
135
|
+
it "should show a correct result" do
|
136
136
|
@response.body.should contain("Jackie Robinson")
|
137
137
|
end
|
138
138
|
|
@@ -154,7 +154,7 @@ describe "MerbAdmin" do
|
|
154
154
|
@response.should be_successful
|
155
155
|
end
|
156
156
|
|
157
|
-
it "should
|
157
|
+
it "should show a correct result" do
|
158
158
|
@response.body.should contain("Sandy Koufax")
|
159
159
|
end
|
160
160
|
|
@@ -177,7 +177,7 @@ describe "MerbAdmin" do
|
|
177
177
|
@response.should be_successful
|
178
178
|
end
|
179
179
|
|
180
|
-
it "should
|
180
|
+
it "should show a correct result" do
|
181
181
|
@response.body.should contain("Moises Alou")
|
182
182
|
end
|
183
183
|
|
@@ -199,7 +199,7 @@ describe "MerbAdmin" do
|
|
199
199
|
@response.should be_successful
|
200
200
|
end
|
201
201
|
|
202
|
-
it "should
|
202
|
+
it "should show a correct result" do
|
203
203
|
end
|
204
204
|
|
205
205
|
it "should not contain an incorrect result" do
|
@@ -220,7 +220,7 @@ describe "MerbAdmin" do
|
|
220
220
|
@response.should be_successful
|
221
221
|
end
|
222
222
|
|
223
|
-
it "should
|
223
|
+
it "should show \"2 results\"" do
|
224
224
|
@response.body.should contain("2 players")
|
225
225
|
end
|
226
226
|
end
|
@@ -236,7 +236,7 @@ describe "MerbAdmin" do
|
|
236
236
|
@response.should be_successful
|
237
237
|
end
|
238
238
|
|
239
|
-
it "should
|
239
|
+
it "should show \"20 results\"" do
|
240
240
|
@response.body.should contain("20 players")
|
241
241
|
end
|
242
242
|
end
|
@@ -294,7 +294,7 @@ describe "MerbAdmin" do
|
|
294
294
|
@response.should be_successful
|
295
295
|
end
|
296
296
|
|
297
|
-
it "should
|
297
|
+
it "should show \"New model\"" do
|
298
298
|
@response.body.should contain("New player")
|
299
299
|
end
|
300
300
|
end
|
@@ -328,9 +328,24 @@ describe "MerbAdmin" do
|
|
328
328
|
@response.should be_successful
|
329
329
|
end
|
330
330
|
|
331
|
-
it "should
|
331
|
+
it "should show \"Edit model\"" do
|
332
332
|
@response.body.should contain("Edit player")
|
333
333
|
end
|
334
|
+
|
335
|
+
it "should show required fields as \"Required\"" do
|
336
|
+
@response.body.should contain(/Name\n\s*Required/)
|
337
|
+
@response.body.should contain(/Number\n\s*Required/)
|
338
|
+
@response.body.should contain(/Team\n\s*Required/)
|
339
|
+
end
|
340
|
+
|
341
|
+
it "should show non-required fields as \"Optional\"" do
|
342
|
+
@response.body.should contain(/Position\n\s*Optional/)
|
343
|
+
@response.body.should contain(/Batting average\n\s*Optional/)
|
344
|
+
@response.body.should contain(/Born on\n\s*Optional/)
|
345
|
+
@response.body.should contain(/Wake at\n\s*Optional/)
|
346
|
+
@response.body.should contain(/Notes\n\s*Optional/)
|
347
|
+
@response.body.should contain(/Draft\n\s*Optional/)
|
348
|
+
end
|
334
349
|
end
|
335
350
|
|
336
351
|
describe "edit with has-one association", :given => "a player exists and a draft exists" do
|
@@ -444,7 +459,7 @@ describe "MerbAdmin" do
|
|
444
459
|
@response = request(url(:admin_create, :model_name => "player"), :method => "post", :params => {:player => {}})
|
445
460
|
end
|
446
461
|
|
447
|
-
it "should
|
462
|
+
it "should show an error message" do
|
448
463
|
@response.body.should contain("Player failed to be created")
|
449
464
|
end
|
450
465
|
end
|
@@ -539,7 +554,7 @@ describe "MerbAdmin" do
|
|
539
554
|
@response = request(url(:admin_update, :model_name => "player", :id => @player.id), :method => "put", :params => {:player => {:number => "a"}})
|
540
555
|
end
|
541
556
|
|
542
|
-
it "should
|
557
|
+
it "should show an error message" do
|
543
558
|
@response.body.should contain("Player failed to be updated")
|
544
559
|
end
|
545
560
|
end
|
@@ -553,7 +568,7 @@ describe "MerbAdmin" do
|
|
553
568
|
@response.should be_successful
|
554
569
|
end
|
555
570
|
|
556
|
-
it "should
|
571
|
+
it "should show \"Delete model\"" do
|
557
572
|
@response.body.should contain("Delete player")
|
558
573
|
end
|
559
574
|
end
|