Displaying 1 result from an estimated 1 matches for "coocoo".
Did you mean:
cooco
2012 Nov 08
1
validates_uniqueness_of(*attr_names) w scope not working in unit test
...de console , but not in a unit test
class User < ActiveRecord::Base
belongs_to :subdomain
validates_uniqueness_of :email, :scope => :subdomain_id
class UserTest < ActiveSupport::TestCase
def initialize_user
@booboo = FactoryGirl.create(:subdomain, name: "booboo")
@coocoo = FactoryGirl.create(:subdomain, name: "coocoo")
FactoryGirl.create(:user, subdomain_id: @booboo[:id], email:
"user.doe-PV5Ro7/Mrj4@public.gmane.org", password: "UkZaHWcy", password_confirmation:
"UkZaHWcy")
end
def teardown
User.delete_all...