File: activerecord_steps.rb

package info (click to toggle)
ruby-carrierwave 0.10.0%2Bgh-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,200 kB
  • ctags: 531
  • sloc: ruby: 7,180; sh: 26; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# encoding: utf-8

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