Skip to content

Commit

Permalink
Use FakeRedis in Testing environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Rio517 committed May 15, 2015
1 parent 162affe commit e90f98c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
17 changes: 1 addition & 16 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lib/integration/nation_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e90f98c

Please sign in to comment.