Permalink
Browse files

fix warnings in tests

  • Loading branch information...
1 parent 6943b37 commit b2230076ed045f82b09707d746c17e4b9d4834e7 @nashby committed Dec 17, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −1 test/support/mock_controller.rb
  2. +2 −1 test/support/models.rb
@@ -6,7 +6,7 @@ def _routes
end
def action_name
- @action_name || "edit"
+ defined?(@action_name) ? @action_name : "edit"
end
def url_for(*args)
View
@@ -45,6 +45,7 @@ class User
:post_count, :lock_version, :amount, :attempts, :action, :credit_card
def initialize(options={})
+ @new_record = false
options.each do |key, value|
send("#{key}=", value)
end if options
@@ -55,7 +56,7 @@ def new_record!
end
def persisted?
- !(@new_record || false)
+ !@new_record
end
def company_attributes=(*)

0 comments on commit b223007

Please sign in to comment.