2013-05-11 09:16:01 -04:00
|
|
|
Given /^I have setup database cleaner to clean multiple databases using redis$/ do
|
|
|
|
#DatabaseCleaner
|
|
|
|
# require "#{File.dirname(__FILE__)}/../../../lib/redis_models"
|
|
|
|
#
|
|
|
|
# DatabaseCleaner[:redis, {:connection => ENV['REDIS_URL_ONE']} ].strategy = :truncation
|
|
|
|
# DatabaseCleaner[:redis, {:connection => ENV['REDIS_URL_TWO']} ].strategy = :truncation
|
|
|
|
end
|
|
|
|
|
|
|
|
When /^I create a widget using redis$/ do
|
|
|
|
RedisWidget.create!
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see ([\d]+) widget using redis$/ do |widget_count|
|
2018-05-04 15:41:54 -04:00
|
|
|
expect(RedisWidget.count).to eq widget_count.to_i
|
2013-05-11 09:16:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
When /^I create a widget in one db using redis$/ do
|
|
|
|
RedisWidgetUsingDatabaseOne.create!
|
|
|
|
end
|
|
|
|
|
|
|
|
When /^I create a widget in another db using redis$/ do
|
|
|
|
RedisWidgetUsingDatabaseTwo.create!
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see ([\d]+) widget in one db using redis$/ do |widget_count|
|
2018-05-04 15:41:54 -04:00
|
|
|
expect(RedisWidgetUsingDatabaseOne.count).to eq widget_count.to_i
|
2013-05-11 09:16:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see ([\d]+) widget in another db using redis$/ do |widget_count|
|
2018-05-04 15:41:54 -04:00
|
|
|
expect(RedisWidgetUsingDatabaseTwo.count).to eq widget_count.to_i
|
2013-05-11 09:16:01 -04:00
|
|
|
end
|