I'm being held up implementing tests with a slight confusion. With User.create I can create and save in multiple tests:
should "test something" do
u1 = User.create(:first_name => "Fred", :last_name => "Flintstone")
assert true
end
should "test something else" do
u1 = User.create(:first_name => "Fred", :last_name => "Flintstone")
assert true
end
but using Factory.create, it throws a ActiveRecord duplicate entry error:
should "test something" do
Factory.create(:amanda_levy)
assert true
end
should "test something else" do
Factory.create(:amanda_levy)
assert true
end
Error: "ActiveRecord::StatementInvalid: Mysql::Error: Duplicate entry"
What gives?