diff --git a/config.ru b/config.ru index bd7803a..9f97443 100644 --- a/config.ru +++ b/config.ru @@ -15,19 +15,4 @@ use Rack::Cors do :headers => :any, :methods => [:get, :post, :put, :options] end -end - -# Code to enable the sidekiq monitoring dashboard -require 'sidekiq' -Sidekiq.configure_client do |config| - config.redis = { :size => 1 } -end - -require 'sidekiq/web' -map '/sidekiq' do - use Rack::Auth::Basic, "Protected Area" do |username, password| - username == 'sidekiq' && password == ENV["SIDEKIQ_DASHBOARD_PASSWORD"] - end - - run Sidekiq::Web -end +end \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index 7954afe..c197365 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,19 @@ +# Code to enable the sidekiq monitoring dashboard +require 'sidekiq' +Sidekiq.configure_client do |config| + config.redis = {size: 1} +end + +require 'sidekiq/web' +map '/sidekiq' do + use Rack::Auth::Basic, "Protected Area" do |username, password| + username == 'sidekiq' && password == ENV["SIDEKIQ_DASHBOARD_PASSWORD"] + end + + run Sidekiq::Web +end + + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/lib/integration/nation_builder.rb b/lib/integration/nation_builder.rb index 5ecf262..2b33bb2 100644 --- a/lib/integration/nation_builder.rb +++ b/lib/integration/nation_builder.rb @@ -84,7 +84,7 @@ def self.list_events def self.create_rsvp(event_id:, person_id:) rescue_oauth_errors do - body = {'rsvp': {'person_id': person_id, 'event_id': event_id}} + body = {'rsvp': {'person_id': person_id}} response = request_handler(endpoint_path: ENDPOINTS[:rsvps_by_event] % event_id, body: body, method: 'post') response['rsvp'] end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 5fbd00a..8d2f0a6 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -24,6 +24,14 @@ # If you are not using ActiveRecord, you can remove this line. ActiveRecord::Migration.maintain_test_schema! +require "fakeredis" +redis_opts = {url: ENV['REDIS_URL'] || ENV['REDISTOGO_URL'], size: 1} +redis_opts.merge!(driver: Redis::Connection::Memory) if defined?(Redis::Connection::Memory) + +Sidekiq.configure_client do |config| + config.redis = redis_opts +end + RSpec.configure do |config| config.use_transactional_fixtures = true