Sha256: 542175299fb9dd241c006a09ed6e275a98b62b78529acf39d0853ecc8d14c91f
Contents?: true
Size: 906 Bytes
Versions: 18
Compression:
Stored size: 906 Bytes
Contents
Given /the "(.+?)" relationship$/ do |relationship| @relationship = @model.send(relationship) end Given /the "(.+?)" relationship on collection item "(.+?)"/ do |key, index| @relationship = @relationship[index.to_i - 1].send(key) end Given /I reload the model/ do @model.reload end When /I read the "(.+?)"/ do |property| @value = @model.send(property) end When /I set the property "(.+?)" to "(.+?)"/ do |key, value| value = value == "true" if %W[true false].include?(value) @model.send("#{key}=", value) end When /I set the relationship property "(.+?)" to "(.+?)"/ do |key, value| old = @model @model = @relationship When %Q[I set the property "#{key}" to "#{value}"] @model = old end When /I add the new record to the relationship/ do @relationship << @new_record end When /I save the relationship/ do @relationship.save end When /I save the model/ do @model.save end
Version data entries
18 entries across 18 versions & 3 rubygems