File: redis_steps.rb

package info (click to toggle)
ruby-database-cleaner 1.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 768 kB
  • sloc: ruby: 4,854; makefile: 10; sh: 4
file content (31 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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|
  RedisWidget.count.should == widget_count.to_i
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|
  RedisWidgetUsingDatabaseOne.count.should == widget_count.to_i
end

Then /^I should see ([\d]+) widget in another db using redis$/ do |widget_count|
  RedisWidgetUsingDatabaseTwo.count.should == widget_count.to_i
end