spec/mongoid/report_spec.rb in mongoid-report-0.0.5 vs spec/mongoid/report_spec.rb in mongoid-report-0.0.6
- old
+ new
@@ -53,6 +53,20 @@
groups = Report4.groups(Model)
expect(groups).to eq([:day])
end
end
+ class Report6
+ include Mongoid::Report
+
+ attach_to Model, as: 'example1' do
+ aggregation_field :field1
+ end
+ end
+
+ describe '.as' do
+ it 'creates settings with "as" name' do
+ expect(Report6.settings).to have_key('example1')
+ end
+ end
+
end