spec/spec_helper.rb in databound-0.1.1 vs spec/spec_helper.rb in databound-0.2.1
- old
+ new
@@ -1,8 +1,7 @@
require 'rubygems'
require 'bundler/setup'
-
require 'combustion'
Combustion.initialize! :all
require 'rspec/rails'
@@ -33,11 +32,11 @@
def convert_scoped_records(obj)
return obj unless obj.is_a?(Hash)
result = obj
- converted = obj[:scoped_records].map do |record|
+ converted = JSON.parse(obj[:scoped_records]).map do |record|
record.except('created_at', 'updated_at')
end
result[:scoped_records] = converted
result
@@ -45,8 +44,8 @@
def gather(attribute, response)
rubize(response).map { |record| record[attribute] }
end
-def all_records
- User.select(:id, :name, :city).map(&:attributes)
+def all_records(model = User)
+ model.select(:id, :name, :city).map(&:attributes)
end