Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in fast_jsonapi.gemspec
gemspec

gem 'oj_mimic_json'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ GEM
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
oj (3.4.0)
oj_mimic_json (1.0.1)
rack (2.0.3)
rack-test (0.8.2)
rack (>= 1.0, < 3)
Expand Down Expand Up @@ -108,6 +109,7 @@ DEPENDENCIES
jsonapi-rb (~> 0.5.0)
jsonapi-serializers (~> 1.0.0)
oj (~> 3.3)
oj_mimic_json
rspec (~> 3.5.0)
rspec-benchmark (~> 0.3.0)
skylight (~> 1.3)
Expand Down
13 changes: 8 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
require 'rspec-benchmark'
require 'byebug'
require 'active_model_serializers'
require 'oj'
require 'jsonapi/serializable'
require 'jsonapi-serializers'
require 'oj'
require 'oj_mimic_json'

Dir[File.dirname(__FILE__) + '/shared/contexts/*.rb'].each {|file| require file }

RSpec.configure do |config|
config.include RSpec::Benchmark::Matchers
if ENV['TRAVIS'] == 'true' || ENV['TRAVIS'] == true
config.filter_run_excluding performance: true
end
# For the PR, show the benchmarks.
# if ENV['TRAVIS'] == 'true' || ENV['TRAVIS'] == true
# config.filter_run_excluding performance: true
# end
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'))
ActiveSupport::Notifications.unsubscribe(ActiveModelSerializers::Logging::RENDER_EVENT)