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
5 changed files
with
53 additions
and
24 deletions.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,7 @@ | |||
FactoryGirl.define do | FactoryGirl.define do | ||
factory :instructor, class: CourseMembership do | factory :course_membership do | ||
association :course, factory: 'webdev' | course nil | ||
person_github_nickname 'instructor' | person_github_nickname nil | ||
role 'Instructor' | role nil | ||
end | end | ||
end | 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,35 @@ | |||
FactoryGirl.define do | |||
factory :person, class: OpenStruct do | |||
name "Test" | |||
email "test@gmail.com" | |||
email_hash "6d2661c5a65f24c8f0bb579b6e0a0d81" | |||
group "Visitor" | |||
website nil | |||
membership_date nil | |||
github_uid "1234" | |||
github_nickname "github_nickname" | |||
permissions Hash[[["Clubhouse", "Administrator"], | |||
["Community", "Administrator"], | |||
["Liskov", "Administrator"]]] | |||
|
|||
course_membership { | |||
FactoryGirl.create(:course_membership, course: course, | |||
person_github_nickname: "#{github_nickname}", | |||
role: "#{permissions['Liskov']}") if course | |||
} | |||
end | |||
|
|||
factory :instructor, parent: "person" do | |||
github_nickname "instructor" | |||
permissions Hash[[["Clubhouse", "Instructor"], | |||
["Community", "Instructor"], | |||
["Liskov", "Instructor"]]] | |||
end | |||
|
|||
factory :student, parent: "person" do | |||
github_nickname "student" | |||
permissions Hash[[["Clubhouse", "Student"], | |||
["Community", "Student"], | |||
["Liskov", "Student"]]] | |||
end | |||
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
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