Skip to content

Commit

Permalink
Change permissions and roles
Browse files Browse the repository at this point in the history
  • Loading branch information
wicz committed Mar 18, 2012
1 parent 6f7bcb3 commit 597704c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/factories/people.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,23 @@
permissions Hash[[["Clubhouse", "Administrator"],
["Community", "Administrator"],
["Liskov", "Administrator"]]]
end

factory :instructor, parent: "person" do
github_nickname "instructor"
course_membership {
FactoryGirl.create(:course_membership, course: course,
person_github_nickname: "#{github_nickname}",
role: "#{permissions['Liskov']}") if course
role: "Instructor") 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"]]]
course_membership {
FactoryGirl.create(:course_membership, course: course,
person_github_nickname: "#{github_nickname}",
role: "Student") if course
}
end
end

0 comments on commit 597704c

Please sign in to comment.