forked from projectfedena/project_fedena
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Factory.define :user do |user| | ||
user.username "username" | ||
user.password 'password' | ||
user.first_name 'first name' | ||
user.last_name 'last name' | ||
user.email '[email protected]' | ||
user.role 'Admin' | ||
end | ||
|
||
Factory.define :admin_user, :parent => :user do |user| | ||
user.username "admin" | ||
user.password 'admin123' | ||
user.first_name 'Fedena' | ||
user.last_name 'Administrator' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require File.expand_path(File.dirname(__FILE__) + './../test_helper') | ||
|
||
class UserTest < ActiveSupport::TestCase | ||
should "be valid with factory" do | ||
assert_valid Factory.build(:user) | ||
assert_valid Factory.build(:admin_user) | ||
end | ||
end |