diff --git a/app/controllers/cangaroo/endpoint_controller.rb b/app/controllers/cangaroo/endpoint_controller.rb index ae90752..fe5455a 100644 --- a/app/controllers/cangaroo/endpoint_controller.rb +++ b/app/controllers/cangaroo/endpoint_controller.rb @@ -33,7 +33,7 @@ def handle_request def ensure_json_request return if request.headers['Content-Type'] == 'application/json' - render nothing: true, status: 406 + head 406 end def key diff --git a/bin/setup b/bin/setup index 87175bf..a63211b 100755 --- a/bin/setup +++ b/bin/setup @@ -13,4 +13,4 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", require "rubygems" require "bundler/setup" -load Gem.bin_path("factory_girl_rails", "setup") +load Gem.bin_path("factory_bot_rails", "setup") diff --git a/cangaroo.gemspec b/cangaroo.gemspec index e247027..a9f2e96 100644 --- a/cangaroo.gemspec +++ b/cangaroo.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'appraisal' s.add_development_dependency 'codeclimate-test-reporter' s.add_development_dependency 'database_cleaner' - s.add_development_dependency 'factory_girl_rails' + s.add_development_dependency 'factory_bot_rails' s.add_development_dependency 'pry-byebug' s.add_development_dependency 'rake' s.add_development_dependency 'rspec-rails' diff --git a/spec/factories/cangaroo_connections.rb b/spec/factories/cangaroo_connections.rb index 48f9470..e98393d 100644 --- a/spec/factories/cangaroo_connections.rb +++ b/spec/factories/cangaroo_connections.rb @@ -1,6 +1,6 @@ require 'securerandom' -FactoryGirl.define do +FactoryBot.define do factory :cangaroo_connection, class: 'Cangaroo::Connection' do name :store url 'www.store.com' diff --git a/spec/jobs/cangaroo/poll_job_spec.rb b/spec/jobs/cangaroo/poll_job_spec.rb index 55f4d22..17057e4 100644 --- a/spec/jobs/cangaroo/poll_job_spec.rb +++ b/spec/jobs/cangaroo/poll_job_spec.rb @@ -90,6 +90,7 @@ class FakePollJob < Cangaroo::PollJob allow_any_instance_of(Cangaroo::Webhook::Client) .to receive(:post) .and_return(parse_fixture('json_payload_ok.json')) + allow_any_instance_of(Cangaroo::Webhook::Client).to receive(:post).and_return(parse_fixture('json_payload_ok.json')) allow(Cangaroo::PerformFlow).to receive(:call).and_return(double(success?: false, message: 'bad failure')) diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb index 196b203..7c9ba1c 100644 --- a/spec/support/factory_girl.rb +++ b/spec/support/factory_girl.rb @@ -1,5 +1,5 @@ -require 'factory_girl_rails' +require 'factory_bot_rails' RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods end