vendredi 23 janvier 2015

`alias_method': undefined method `to_json' for class `Object' (NameError)

I want running my test through Rspec but getting errors full trace here


one of them is 'alias_method': undefined methodto_json' for class `Object' (NameError)' and i even dont know from where it comes



require 'rubygems'
require 'spork'

Spork.prefork do
ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../../config/environment', __FILE__)
require 'capybara/rspec'
require 'rspec/rails'
require 'database_cleaner'
require 'factory_girl'
Dir[Rails.root + 'spec/support/**/*.rb'].map &method(:require)
RSpec.configure do |config|
config.include Capybara::DSL
config.include FactoryGirl::Syntax::Methods
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.mock_with :rspec
config.order = :random
config.use_transactional_fixtures = false
config.use_instantiated_fixtures = true
config.global_fixtures = :all
config.infer_spec_type_from_file_location!
config.raise_errors_for_deprecations!
config.output_stream = 'rspec.xml'
config.formatter = RspecJunitFormatter
config.before do
DatabaseCleaner.start
ActionMailer::Base.deliveries.clear
end
config.after do
DatabaseCleaner.clean
end
end
end


chunk of gemfile



group :development, :test do
gem 'better_errors'
gem 'binding_of_caller'
gem 'capybara'
gem 'database_cleaner'
gem 'factory_girl_rails', '~> 4.0'
gem 'faker', git: 'http://ift.tt/1tgy2R1'
gem 'pry'
gem 'rspec-rails', '~>3.0.0'
gem 'selenium-webdriver'
gem 'spork', :github => 'sporkrb/spork'
gem 'spork-rails', :github => 'sporkrb/spork-rails'
gem 'rspec_junit_formatter', :git => 'http://ift.tt/1yS2Fgg'
gem 'rspec-core'
gem 'rubocop', require: false
end


Any suggestions how to fix it?


Ruby 2.2.0


Rails 4.1.9


Aucun commentaire:

Enregistrer un commentaire