File: activerecord_steps.rb

package info (click to toggle)
ruby-carrierwave 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,692 kB
  • sloc: ruby: 9,881; sh: 26; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Given /^an activerecord class that uses the '([^\']*)' table$/ do |name|
  @mountee_klass = Class.new(ActiveRecord::Base)
  @mountee_klass.table_name = name
end

Given /^an instance of the activerecord class$/ do
  @instance = @mountee_klass.new
end

When /^I save the active record$/ do
  @instance.save!
end

When /^I reload the active record$/ do
  @instance = @instance.class.find(@instance.id)
end

When /^I delete the active record$/ do
  @instance.destroy
end