gowalla/Likeable — Issue #8: undefined method 'hkeys' for "localhost:5959":String
Author: charleschen
Created: 2011-11-18 07:16:23+00:00
State: open

One of spec test is failing when deleting data that has "include Likeable":

1) Product on destroy should destroy reverse association
Failure/Error: relationship.destroy
NoMethodError:
undefined method `hkeys' for "localhost:6969":String

it 'should destroy reverse association' do
@product.reverse_stock_strains.create(:club_id => Factory(:club).id)
lambda {@product.destroy}.should change(Stock,:count).from(1).to(0)
end

Stock is the model that is including likeable. Since Stock is dependent on Product, it destroy Stock when Product is destroyed. That's when it throws the error.

localhost:6969 is where my redis test server:

RSpec.configure do |config|
REDIS_PID = "#{Rails.root}/tmp/pids/redis-test.pid"
REDIS_CACHE_PATH = "#{Rails.root}/tmp/cache/"

config.before(:suite) do
redis_options = {
"daemonize" => 'yes',
"pidfile" => REDIS_PID,
"port" => 6969,
"timeout" => 300,
"save 900" => 1,
"save 300" => 1,
"save 60" => 10000,
"dbfilename" => "dump.rdb",
"dir" => REDIS_CACHE_PATH,
"loglevel" => "debug",
"logfile" => "stdout",
"databases" => 16
}.map { |k, v| "#{k} #{v}" }.join('\n')
`echo '#{redis_options}' | redis-server -`
end
config.after(:suite) do
%x{
cat #{REDIS_PID} | xargs kill -QUIT
rm -f #{REDIS_CACHE_PATH}dump.rdb
}
end
end

is anyone else getting this error?