fix warnings in tests

This commit is contained in:
Vasiliy Ermolovich 2011-12-17 13:57:43 +03:00
parent 6943b37d64
commit b2230076ed
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@ class MockController
end end
def action_name def action_name
@action_name || "edit" defined?(@action_name) ? @action_name : "edit"
end end
def url_for(*args) def url_for(*args)

View File

@ -45,6 +45,7 @@ class User
:post_count, :lock_version, :amount, :attempts, :action, :credit_card :post_count, :lock_version, :amount, :attempts, :action, :credit_card
def initialize(options={}) def initialize(options={})
@new_record = false
options.each do |key, value| options.each do |key, value|
send("#{key}=", value) send("#{key}=", value)
end if options end if options
@ -55,7 +56,7 @@ class User
end end
def persisted? def persisted?
!(@new_record || false) !@new_record
end end
def company_attributes=(*) def company_attributes=(*)