rails_admin 0.1.2 → 0.2.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.
Files changed (95) hide show
  1. data/Gemfile +18 -20
  2. data/README.md +8 -1
  3. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +5 -4
  4. data/app/assets/stylesheets/rails_admin/base/theming.css.scss +4 -4
  5. data/app/controllers/rails_admin/main_controller.rb +11 -2
  6. data/app/helpers/rails_admin/application_helper.rb +1 -1
  7. data/app/helpers/rails_admin/form_builder.rb +3 -3
  8. data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +4 -4
  9. data/app/views/rails_admin/main/_form_filtering_select.html.haml +2 -2
  10. data/app/views/rails_admin/main/_form_nested_one.html.haml +1 -1
  11. data/app/views/rails_admin/main/_form_text.html.haml +2 -1
  12. data/app/views/rails_admin/main/export.html.haml +2 -2
  13. data/app/views/rails_admin/main/index.html.haml +5 -5
  14. data/app/views/rails_admin/main/show.html.haml +1 -1
  15. data/lib/generators/rails_admin/templates/initializer.erb +5 -5
  16. data/lib/rails_admin/abstract_model.rb +1 -0
  17. data/lib/rails_admin/config.rb +1 -1
  18. data/lib/rails_admin/config/actions/base.rb +1 -1
  19. data/lib/rails_admin/config/actions/edit.rb +5 -4
  20. data/lib/rails_admin/config/actions/new.rb +5 -4
  21. data/lib/rails_admin/config/fields/association.rb +10 -10
  22. data/lib/rails_admin/config/fields/base.rb +10 -4
  23. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +2 -2
  24. data/lib/rails_admin/config/fields/types/boolean.rb +4 -4
  25. data/lib/rails_admin/config/fields/types/bson_object_id.rb +4 -4
  26. data/lib/rails_admin/config/fields/types/carrierwave.rb +3 -3
  27. data/lib/rails_admin/config/fields/types/datetime.rb +5 -5
  28. data/lib/rails_admin/config/fields/types/enum.rb +5 -5
  29. data/lib/rails_admin/config/fields/types/file_upload.rb +10 -6
  30. data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -1
  31. data/lib/rails_admin/config/fields/types/has_one_association.rb +3 -3
  32. data/lib/rails_admin/config/fields/types/integer.rb +1 -1
  33. data/lib/rails_admin/config/fields/types/paperclip.rb +2 -2
  34. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +8 -4
  35. data/lib/rails_admin/config/fields/types/serialized.rb +2 -2
  36. data/lib/rails_admin/config/fields/types/string.rb +3 -3
  37. data/lib/rails_admin/config/fields/types/text.rb +22 -15
  38. data/lib/rails_admin/config/fields/types/time.rb +1 -1
  39. data/lib/rails_admin/config/hideable.rb +1 -1
  40. data/lib/rails_admin/config/model.rb +4 -0
  41. data/lib/rails_admin/config/sections/modal.rb +1 -1
  42. data/lib/rails_admin/engine.rb +1 -1
  43. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +2 -1
  44. data/lib/rails_admin/support/csv_converter.rb +1 -1
  45. data/lib/rails_admin/version.rb +2 -2
  46. data/lib/rails_admin/version.rbc +582 -0
  47. data/lib/tasks/rails_admin.rake +2 -2
  48. data/spec/controllers/main_controller_spec.rb +113 -45
  49. data/spec/dummy_app/Gemfile +11 -25
  50. data/spec/dummy_app/Gemfile.lock +214 -0
  51. data/spec/dummy_app/app/active_record/comment.rb +1 -1
  52. data/spec/dummy_app/app/active_record/field_test.rb +0 -1
  53. data/spec/dummy_app/config/initializers/strong_parameters.rb +2 -0
  54. data/spec/dummy_app/db/test.sqlite3 +0 -0
  55. data/spec/dummy_app/log/test.log +97612 -0
  56. data/spec/helpers/application_helper_spec.rb +24 -24
  57. data/spec/helpers/form_builder_spec.rb +4 -4
  58. data/spec/integration/authorization/cancan_spec.rb +3 -3
  59. data/spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +2 -2
  60. data/spec/integration/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +2 -2
  61. data/spec/integration/basic/create/rails_admin_basic_create_spec.rb +9 -9
  62. data/spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb +1 -1
  63. data/spec/integration/basic/delete/rails_admin_basic_delete_spec.rb +4 -4
  64. data/spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb +9 -9
  65. data/spec/integration/basic/edit/rails_admin_basic_edit_spec.rb +10 -10
  66. data/spec/integration/basic/export/rails_admin_basic_export_spec.rb +5 -5
  67. data/spec/integration/basic/list/rails_admin_basic_list_spec.rb +32 -25
  68. data/spec/integration/basic/new/rails_admin_basic_new_spec.rb +8 -8
  69. data/spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb +3 -3
  70. data/spec/integration/basic/show/rails_admin_basic_show_spec.rb +6 -6
  71. data/spec/integration/basic/update/rails_admin_basic_update_spec.rb +13 -13
  72. data/spec/integration/config/edit/rails_admin_config_edit_spec.rb +97 -76
  73. data/spec/integration/config/list/rails_admin_config_list_spec.rb +32 -32
  74. data/spec/integration/config/show/rails_admin_config_show_spec.rb +23 -23
  75. data/spec/integration/history/rails_admin_history_spec.rb +6 -6
  76. data/spec/integration/rails_admin_spec.rb +17 -17
  77. data/spec/integration/relation_spec.rb +7 -7
  78. data/spec/unit/abstract_model_spec.rb +11 -5
  79. data/spec/unit/active_record_extension_spec.rb +2 -2
  80. data/spec/unit/adapters/active_record/abstract_object_spec.rb +8 -8
  81. data/spec/unit/adapters/active_record_spec.rb +6 -6
  82. data/spec/unit/adapters/mongoid/abstract_object_spec.rb +1 -1
  83. data/spec/unit/adapters/mongoid_spec.rb +12 -12
  84. data/spec/unit/config/actions/base_spec.rb +2 -2
  85. data/spec/unit/config/actions_spec.rb +16 -16
  86. data/spec/unit/config/fields/base_spec.rb +61 -49
  87. data/spec/unit/config/fields/date_spec.rb +4 -4
  88. data/spec/unit/config/fields/datetime_spec.rb +4 -4
  89. data/spec/unit/config/fields/file_upload_spec.rb +21 -0
  90. data/spec/unit/config/fields/time_spec.rb +3 -3
  91. data/spec/unit/config/fields/timestamp_spec.rb +1 -1
  92. data/spec/unit/config/model_spec.rb +10 -10
  93. data/spec/unit/config/sections_spec.rb +4 -4
  94. data/spec/unit/config_spec.rb +9 -9
  95. metadata +17 -218
@@ -5,7 +5,7 @@ describe "RailsAdmin Config DSL List Section" do
5
5
  subject { page }
6
6
 
7
7
  describe "css hooks" do
8
- it "should be present" do
8
+ it "is present" do
9
9
  RailsAdmin.config Team do
10
10
  list do
11
11
  field :name
@@ -28,7 +28,7 @@ describe "RailsAdmin Config DSL List Section" do
28
28
  end
29
29
  end
30
30
 
31
- it "should be configurable per model" do
31
+ it "is configurable per model" do
32
32
  RailsAdmin.config League do
33
33
  list do
34
34
  items_per_page 1
@@ -43,13 +43,13 @@ describe "RailsAdmin Config DSL List Section" do
43
43
 
44
44
  describe "items' fields" do
45
45
 
46
- it "should show all by default" do
46
+ it "shows all by default" do
47
47
  visit index_path(:model_name => "fan")
48
48
  expect(all("th").map(&:text).delete_if{|t| /^\n*$/ =~ t }).
49
49
  to match_array ["Id", "Created at", "Updated at", "His Name", "Teams"]
50
50
  end
51
51
 
52
- it "should hide some fields on demand with a block" do
52
+ it "hides some fields on demand with a block" do
53
53
  RailsAdmin.config Fan do
54
54
  list do
55
55
  exclude_fields_if do
@@ -62,7 +62,7 @@ describe "RailsAdmin Config DSL List Section" do
62
62
  to match_array ["Id", "His Name", "Teams"]
63
63
  end
64
64
 
65
- it "should hide some fields on demand with fields list" do
65
+ it "hides some fields on demand with fields list" do
66
66
  RailsAdmin.config Fan do
67
67
  list do
68
68
  exclude_fields :created_at, :updated_at
@@ -73,7 +73,7 @@ describe "RailsAdmin Config DSL List Section" do
73
73
  to match_array ["Id", "His Name", "Teams"]
74
74
  end
75
75
 
76
- it "should add some fields on demand with a block" do
76
+ it "adds some fields on demand with a block" do
77
77
  RailsAdmin.config Fan do
78
78
  list do
79
79
  include_fields_if do
@@ -86,7 +86,7 @@ describe "RailsAdmin Config DSL List Section" do
86
86
  to match_array ["Id", "His Name", "Teams"]
87
87
  end
88
88
 
89
- it "should show some fields on demand with fields list, respect ordering and configure them" do
89
+ it "shows some fields on demand with fields list, respect ordering and configure them" do
90
90
  RailsAdmin.config Fan do
91
91
  list do
92
92
  fields :name, PK_COLUMN do
@@ -101,7 +101,7 @@ describe "RailsAdmin Config DSL List Section" do
101
101
  to match_array ["Modified Id", "Modified His Name"]
102
102
  end
103
103
 
104
- it "should show all fields if asked" do
104
+ it "shows all fields if asked" do
105
105
  RailsAdmin.config Fan do
106
106
  list do
107
107
  include_all_fields
@@ -114,7 +114,7 @@ describe "RailsAdmin Config DSL List Section" do
114
114
  to match_array ["Id", "Created at", "Updated at", "His Name", "Teams"]
115
115
  end
116
116
 
117
- it "should appear in order defined" do
117
+ it "appears in order defined" do
118
118
  RailsAdmin.config Fan do
119
119
  list do
120
120
  field :updated_at
@@ -128,7 +128,7 @@ describe "RailsAdmin Config DSL List Section" do
128
128
  to eq(["Updated at", "His Name", "Id", "Created at"])
129
129
  end
130
130
 
131
- it "should only list the defined fields if some fields are defined" do
131
+ it "only lists the defined fields if some fields are defined" do
132
132
  RailsAdmin.config Fan do
133
133
  list do
134
134
  field PK_COLUMN
@@ -141,7 +141,7 @@ describe "RailsAdmin Config DSL List Section" do
141
141
  should have_no_selector("th:nth-child(4).header")
142
142
  end
143
143
 
144
- it "should delegate the label option to the ActiveModel API" do
144
+ it "delegates the label option to the ActiveModel API" do
145
145
  RailsAdmin.config Fan do
146
146
  list do
147
147
  field :name
@@ -151,7 +151,7 @@ describe "RailsAdmin Config DSL List Section" do
151
151
  expect(find("th:nth-child(2)")).to have_content("His Name")
152
152
  end
153
153
 
154
- it "should be renameable" do
154
+ it "is renameable" do
155
155
  RailsAdmin.config Fan do
156
156
  list do
157
157
  field PK_COLUMN do
@@ -165,7 +165,7 @@ describe "RailsAdmin Config DSL List Section" do
165
165
  expect(find("th:nth-child(3)")).to have_content("His Name")
166
166
  end
167
167
 
168
- it "should be renameable by type" do
168
+ it "is renameable by type" do
169
169
  RailsAdmin.config Fan do
170
170
  list do
171
171
  fields_of_type :datetime do
@@ -178,8 +178,8 @@ describe "RailsAdmin Config DSL List Section" do
178
178
  to match_array ["Id", "Created at (datetime)", "Updated at (datetime)", "His Name", "Teams"]
179
179
  end
180
180
 
181
- it "should be globally renameable by type" do
182
- RailsAdmin.config 'Fan' do
181
+ it "is globally renameable by type" do
182
+ RailsAdmin.config Fan do
183
183
  list do
184
184
  fields_of_type :datetime do
185
185
  label { "#{label} (datetime)" }
@@ -191,7 +191,7 @@ describe "RailsAdmin Config DSL List Section" do
191
191
  to match_array ["Id", "Created at (datetime)", "Updated at (datetime)", "His Name", "Teams"]
192
192
  end
193
193
 
194
- it "should be sortable by default" do
194
+ it "is sortable by default" do
195
195
  visit index_path(:model_name => "fan")
196
196
  should have_selector("th:nth-child(2).header")
197
197
  should have_selector("th:nth-child(3).header")
@@ -199,7 +199,7 @@ describe "RailsAdmin Config DSL List Section" do
199
199
  should have_selector("th:nth-child(5).header")
200
200
  end
201
201
 
202
- it "should have option to disable sortability" do
202
+ it "has option to disable sortability" do
203
203
  RailsAdmin.config Fan do
204
204
  list do
205
205
  field PK_COLUMN do
@@ -213,7 +213,7 @@ describe "RailsAdmin Config DSL List Section" do
213
213
  should have_selector("th:nth-child(3).header")
214
214
  end
215
215
 
216
- it "should have option to disable sortability by type" do
216
+ it "has option to disable sortability by type" do
217
217
  RailsAdmin.config Fan do
218
218
  list do
219
219
  fields_of_type :datetime do
@@ -232,8 +232,8 @@ describe "RailsAdmin Config DSL List Section" do
232
232
  should have_no_selector("th:nth-child(5).header")
233
233
  end
234
234
 
235
- it "should have option to disable sortability by type globally" do
236
- RailsAdmin.config 'Fan' do
235
+ it "has option to disable sortability by type globally" do
236
+ RailsAdmin.config Fan do
237
237
  list do
238
238
  fields_of_type :datetime do
239
239
  sortable false
@@ -251,7 +251,7 @@ describe "RailsAdmin Config DSL List Section" do
251
251
  should have_no_selector("th:nth-child(5).header")
252
252
  end
253
253
 
254
- it "should have option to hide fields by type" do
254
+ it "has option to hide fields by type" do
255
255
  RailsAdmin.config Fan do
256
256
  list do
257
257
  fields_of_type :datetime do
@@ -264,8 +264,8 @@ describe "RailsAdmin Config DSL List Section" do
264
264
  to match_array ["Id", "His Name", "Teams"]
265
265
  end
266
266
 
267
- it "should have option to hide fields by type globally" do
268
- RailsAdmin.config 'Fan' do
267
+ it "has option to hide fields by type globally" do
268
+ RailsAdmin.config Fan do
269
269
  list do
270
270
  fields_of_type :datetime do
271
271
  hide
@@ -277,7 +277,7 @@ describe "RailsAdmin Config DSL List Section" do
277
277
  to match_array ["Id", "His Name", "Teams"]
278
278
  end
279
279
 
280
- it "should have option to customize column width" do
280
+ it "has option to customize column width" do
281
281
  RailsAdmin.config Fan do
282
282
  list do
283
283
  field PK_COLUMN do
@@ -294,7 +294,7 @@ describe "RailsAdmin Config DSL List Section" do
294
294
  expect(find('style')).to have_content("#list td.#{PK_COLUMN}_field")
295
295
  end
296
296
 
297
- it "should have option to customize output formatting" do
297
+ it "has option to customize output formatting" do
298
298
  RailsAdmin.config Fan do
299
299
  list do
300
300
  field PK_COLUMN
@@ -313,7 +313,7 @@ describe "RailsAdmin Config DSL List Section" do
313
313
  expect(find('tbody tr:nth-child(2) td:nth-child(3)')).to have_content(@fans[0].name.upcase)
314
314
  end
315
315
 
316
- it "should have a simple option to customize output formatting of date fields" do
316
+ it "has a simple option to customize output formatting of date fields" do
317
317
  RailsAdmin.config Fan do
318
318
  list do
319
319
  field PK_COLUMN
@@ -329,7 +329,7 @@ describe "RailsAdmin Config DSL List Section" do
329
329
  should have_selector("tbody tr:nth-child(1) td:nth-child(4)", :text => /\d{2} \w{3} \d{1,2}:\d{1,2}/)
330
330
  end
331
331
 
332
- it "should have option to customize output formatting of date fields" do
332
+ it "has option to customize output formatting of date fields" do
333
333
  RailsAdmin.config Fan do
334
334
  list do
335
335
  field PK_COLUMN
@@ -345,7 +345,7 @@ describe "RailsAdmin Config DSL List Section" do
345
345
  should have_selector("tbody tr:nth-child(1) td:nth-child(4)", :text => /\d{4}-\d{2}-\d{2}/)
346
346
  end
347
347
 
348
- it "should allow addition of virtual fields (object methods)" do
348
+ it "allows addition of virtual fields (object methods)" do
349
349
  RailsAdmin.config Team do
350
350
  list do
351
351
  field PK_COLUMN
@@ -397,7 +397,7 @@ describe "RailsAdmin Config DSL List Section" do
397
397
  end
398
398
  end
399
399
 
400
- it "should have reverse direction by default" do
400
+ it "has reverse direction by default" do
401
401
  RailsAdmin.config Player do
402
402
  list do
403
403
  sort_by :created_at
@@ -409,7 +409,7 @@ describe "RailsAdmin Config DSL List Section" do
409
409
  end
410
410
  end
411
411
 
412
- it "should allow change default direction" do
412
+ it "allows change default direction" do
413
413
  RailsAdmin.config Player do
414
414
  list do
415
415
  sort_by :created_at
@@ -423,8 +423,8 @@ describe "RailsAdmin Config DSL List Section" do
423
423
  end
424
424
  end
425
425
 
426
- describe 'embedded model', :mongoid => true do
427
- it "should not show link to individual object's page" do
426
+ describe "embedded model", :mongoid => true do
427
+ it "does not show link to individual object's page" do
428
428
  RailsAdmin.config FieldTest do
429
429
  list do
430
430
  field :embeds
@@ -22,25 +22,25 @@ describe "RailsAdmin Config DSL Show Section" do
22
22
  let(:uri) { show_path(:model_name => 'player', :id => @player.id, :format => :json) }
23
23
  let(:body) { page.body }
24
24
 
25
- it 'should create a JSON uri' do
25
+ it "creates a JSON uri" do
26
26
  expect(uri).to eq("/admin/player/#{@player.id}.json")
27
27
  end
28
28
 
29
- it 'should contain the JSONified object' do
29
+ it "contains the JSONified object" do
30
30
  expect(body).to include(@player.to_json)
31
31
  end
32
32
  end
33
33
 
34
34
  describe "compact_show_view" do
35
35
 
36
- it 'should hide empty fields in show view by default' do
36
+ it "hides empty fields in show view by default" do
37
37
  @player = FactoryGirl.create :player
38
38
  visit show_path(:model_name => "league", :id => @player.id)
39
39
  should_not have_css(".born_on_field")
40
40
  end
41
41
 
42
42
 
43
- it 'should be disactivable' do
43
+ it "is disactivable" do
44
44
  RailsAdmin.config do |c|
45
45
  c.compact_show_view = false
46
46
  end
@@ -52,14 +52,14 @@ describe "RailsAdmin Config DSL Show Section" do
52
52
  end
53
53
 
54
54
  describe "css hooks" do
55
- it "should be present" do
55
+ it "is present" do
56
56
  do_request
57
57
  should have_selector("dt.name_field.string_type")
58
58
  end
59
59
  end
60
60
 
61
61
  describe "field groupings" do
62
- it "should be hideable" do
62
+ it "is hideable" do
63
63
  RailsAdmin.config Team do
64
64
  show do
65
65
  group :default do
@@ -80,7 +80,7 @@ describe "RailsAdmin Config DSL Show Section" do
80
80
  end
81
81
  end
82
82
 
83
- it "should hide association groupings by the name of the association" do
83
+ it "hides association groupings by the name of the association" do
84
84
  RailsAdmin.config Team do
85
85
  show do
86
86
  group :players do
@@ -94,7 +94,7 @@ describe "RailsAdmin Config DSL Show Section" do
94
94
  should_not have_selector("h4", :text => "Players")
95
95
  end
96
96
 
97
- it "should be renameable" do
97
+ it "is renameable" do
98
98
  RailsAdmin.config Team do
99
99
  show do
100
100
  group :default do
@@ -108,7 +108,7 @@ describe "RailsAdmin Config DSL Show Section" do
108
108
  should have_selector("h4", :text => "Renamed group")
109
109
  end
110
110
 
111
- it "should have accessor for its fields" do
111
+ it "has accessor for its fields" do
112
112
  RailsAdmin.config Team do
113
113
  show do
114
114
  group :default do
@@ -132,7 +132,7 @@ describe "RailsAdmin Config DSL Show Section" do
132
132
  should have_selector(".division_field")
133
133
  end
134
134
 
135
- it "should have accessor for its fields by type" do
135
+ it "has accessor for its fields by type" do
136
136
  RailsAdmin.config Team do
137
137
  show do
138
138
  group :default do
@@ -162,7 +162,7 @@ describe "RailsAdmin Config DSL Show Section" do
162
162
 
163
163
  describe "items' fields" do
164
164
 
165
- it "should show all by default" do
165
+ it "shows all by default" do
166
166
  do_request
167
167
 
168
168
  %w[division name logo_url manager
@@ -173,7 +173,7 @@ describe "RailsAdmin Config DSL Show Section" do
173
173
  end
174
174
  end
175
175
 
176
- it "should only show the defined fields and appear in order defined" do
176
+ it "only shows the defined fields and appear in order defined" do
177
177
  RailsAdmin.config Team do
178
178
  show do
179
179
  field :manager
@@ -190,7 +190,7 @@ describe "RailsAdmin Config DSL Show Section" do
190
190
  end
191
191
 
192
192
 
193
- it "should delegates the label option to the ActiveModel API" do
193
+ it "delegates the label option to the ActiveModel API" do
194
194
  RailsAdmin.config Team do
195
195
  show do
196
196
  field :manager
@@ -204,7 +204,7 @@ describe "RailsAdmin Config DSL Show Section" do
204
204
  should have_selector(".label", :text => "Some Fans")
205
205
  end
206
206
 
207
- it "should be renameable" do
207
+ it "is renameable" do
208
208
  RailsAdmin.config Team do
209
209
  show do
210
210
  field :manager do
@@ -222,7 +222,7 @@ describe "RailsAdmin Config DSL Show Section" do
222
222
  should have_selector(".label", :text => "Name")
223
223
  end
224
224
 
225
- it "should be renameable by type" do
225
+ it "is renameable by type" do
226
226
  RailsAdmin.config Team do
227
227
  show do
228
228
  fields_of_type :string do
@@ -241,8 +241,8 @@ describe "RailsAdmin Config DSL Show Section" do
241
241
  end
242
242
  end
243
243
 
244
- it "should be globally renameable by type" do
245
- RailsAdmin.config 'Team' do
244
+ it "is globally renameable by type" do
245
+ RailsAdmin.config Team do
246
246
  show do
247
247
  fields_of_type :string do
248
248
  label { "#{label} (STRING)" }
@@ -260,7 +260,7 @@ describe "RailsAdmin Config DSL Show Section" do
260
260
  end
261
261
  end
262
262
 
263
- it "should be hideable" do
263
+ it "is hideable" do
264
264
  RailsAdmin.config Team do
265
265
  show do
266
266
  field :manager do
@@ -277,7 +277,7 @@ describe "RailsAdmin Config DSL Show Section" do
277
277
  should have_selector(".name_field")
278
278
  end
279
279
 
280
- it "should be hideable by type" do
280
+ it "is hideable by type" do
281
281
  RailsAdmin.config Team do
282
282
  show do
283
283
  fields_of_type :string do
@@ -297,8 +297,8 @@ describe "RailsAdmin Config DSL Show Section" do
297
297
  end
298
298
  end
299
299
 
300
- it "should be globally hideable by type" do
301
- RailsAdmin.config 'Team' do
300
+ it "is globally hideable by type" do
301
+ RailsAdmin.config Team do
302
302
  show do
303
303
  fields_of_type :string do
304
304
  hide
@@ -318,8 +318,8 @@ describe "RailsAdmin Config DSL Show Section" do
318
318
  end
319
319
  end
320
320
 
321
- describe 'embedded model', :mongoid => true do
322
- it "should not show link to individual object's page" do
321
+ describe "embedded model", :mongoid => true do
322
+ it "does not show link to individual object's page" do
323
323
  @record = FactoryGirl.create :field_test
324
324
  2.times.each{|i| @record.embeds.create :name => "embed #{i}"}
325
325
  visit show_path(:model_name => "field_test", :id => @record.id)
@@ -12,13 +12,13 @@ describe "RailsAdmin History", :active_record => true do
12
12
  end
13
13
  end
14
14
 
15
- it "should fetch one page of history" do
15
+ it "fetches on page of history" do
16
16
  histories = RailsAdmin::History.history_for_model @model, nil, false, false, false, nil, 20
17
17
  expect(histories.total_count).to eq(30)
18
18
  expect(histories.count).to eq(20)
19
19
  end
20
20
 
21
- it "should respect RailsAdmin::Config.default_items_per_page" do
21
+ it "respects RailsAdmin::Config.default_items_per_page" do
22
22
  RailsAdmin.config.default_items_per_page = 15
23
23
  histories = RailsAdmin::History.history_for_model @model, nil, false, false, false, nil
24
24
  expect(histories.total_count).to eq(30)
@@ -54,7 +54,7 @@ describe "RailsAdmin History", :active_record => true do
54
54
  # https://github.com/sferik/rails_admin/issues/362
55
55
  # test that no link uses the "wildcard route" with the history
56
56
  # controller and for_model method
57
- it "should not use the 'wildcard route'" do
57
+ it "does not use the 'wildcard route'" do
58
58
  expect(page).to have_selector("a[href*='all=true']") # make sure we're fully testing pagination
59
59
  expect(page).to have_no_selector("a[href^='/rails_admin/history/for_model']")
60
60
  end
@@ -68,17 +68,17 @@ describe "RailsAdmin History", :active_record => true do
68
68
  end
69
69
  end
70
70
 
71
- it 'should get latest ones' do
71
+ it "gets latest ones" do
72
72
  expect(RailsAdmin::History.latest.count).to eq(100)
73
73
  end
74
74
 
75
- it 'should get latest ones orderly' do
75
+ it "gets latest ones orderly" do
76
76
  latest = RailsAdmin::History.latest
77
77
  expect(latest.first.message).to eq("change 100")
78
78
  expect(latest.last.message).to eq("change 1")
79
79
  end
80
80
 
81
- it "should render a XHR request successfully" do
81
+ it "renders a XHR request successfully" do
82
82
  xhr :get, history_index_path(@model, :page => 2)
83
83
  end
84
84
  end