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 CHANGED
@@ -16,7 +16,7 @@ At the command prompt, type:
16
16
 
17
17
  In your app, add the following dependency to `config/dependencies.rb`:
18
18
 
19
- dependency "merb-admin", "0.4.7"
19
+ dependency "merb-admin", "0.4.8"
20
20
 
21
21
  Add the following route to `config/router.rb`:
22
22
 
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.7"
12
+ GEM_VERSION = "0.4.8"
13
13
 
14
14
  spec = Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "merb"
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  name = property[:name]
3
3
  label = property[:pretty_name]
4
- required = property[:nullable?]
4
+ required = !property[:nullable?]
5
5
  %>
6
6
  <div>
7
7
  <%= text_area(name, :cols => 80, :label => label) %>
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.7"
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
@@ -70,7 +70,7 @@ describe "MerbAdmin" do
70
70
  @response.should be_successful
71
71
  end
72
72
 
73
- it "should contain \"Site administration\"" do
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 contain \"Select model to edit\"" do
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 contain a correct result" do
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 contain a correct result" do
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 contain a correct result" do
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 contain a correct result" do
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 contain \"2 results\"" do
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 contain \"20 results\"" do
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 contain \"New model\"" do
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 contain \"Edit model\"" do
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 contain an error message" do
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 contain an error message" do
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 contain \"Delete model\"" do
571
+ it "should show \"Delete model\"" do
557
572
  @response.body.should contain("Delete player")
558
573
  end
559
574
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Michaels-Ober