Created
February 25, 2018 03:30
-
-
Save shishirmk/d760dca74206bd585e4ee812c3260a58 to your computer and use it in GitHub Desktop.
diff of fast_jsonapi dev branch to try key_transfrom :unaltered
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/lib/object_serializer_performance_spec.rb b/spec/lib/object_serializer_performance_spec.rb | |
index e718953..c589ea8 100644 | |
--- a/spec/lib/object_serializer_performance_spec.rb | |
+++ b/spec/lib/object_serializer_performance_spec.rb | |
@@ -107,13 +107,13 @@ describe FastJsonapi::ObjectSerializer, performance: true do | |
data[k][:time] = Benchmark.measure { data[k][:json] = v.send(json_method) }.real * 1000 | |
end | |
- print_stats(message, movie_count, data) | |
+ # print_stats(message, movie_count, data) | |
data | |
end | |
context 'when comparing with AMS 0.10.x' do | |
- [1, 25, 250, 1000].each do |movie_count| | |
+ [25, 250, 1000].each do |movie_count| | |
it "should serialize #{movie_count} records atleast #{SERIALIZERS[:ams][:speed_factor]} times faster than AMS" do | |
ams_movies = build_ams_movies(movie_count) | |
movies = build_movies(movie_count) | |
@@ -146,7 +146,7 @@ describe FastJsonapi::ObjectSerializer, performance: true do | |
end | |
context 'when comparing with AMS 0.10.x and with includes and meta' do | |
- [1, 25, 250, 1000].each do |movie_count| | |
+ [25, 250, 1000].each do |movie_count| | |
it "should serialize #{movie_count} records atleast #{SERIALIZERS[:ams][:speed_factor]} times faster than AMS" do | |
ams_movies = build_ams_movies(movie_count) | |
movies = build_movies(movie_count) | |
@@ -183,7 +183,7 @@ describe FastJsonapi::ObjectSerializer, performance: true do | |
end | |
context 'when comparing with AMS 0.10.x and with polymorphic has_many' do | |
- [1, 25, 250, 1000].each do |group_count| | |
+ [25, 250, 1000].each do |group_count| | |
it "should serialize #{group_count} records at least #{SERIALIZERS[:ams][:speed_factor]} times faster than AMS" do | |
ams_groups = build_ams_groups(group_count) | |
groups = build_groups(group_count) | |
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb | |
index d7aac0c..d33bbda 100644 | |
--- a/spec/spec_helper.rb | |
+++ b/spec/spec_helper.rb | |
@@ -17,5 +17,5 @@ end | |
Oj.optimize_rails | |
ActiveModel::Serializer.config.adapter = :json_api | |
-ActiveModel::Serializer.config.key_transform = :underscore | |
+ActiveModel::Serializer.config.key_transform = :unaltered | |
ActiveModelSerializers.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new('/dev/null')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment