I’m using rspec for testing w my rails 3 app. I need to seed the database before the tests start. How can I seed the database with the following:
/db/seeds.rb
["Admin", "Member"].each do |role_name|
Role.find_or_create_by_name(role_name)
end
Thanks
Try, something like this
You can get a list of all rake commands doing
If this is test data, you may want to look at putting it into fixtures which will be loaded on the start of the tests.