From 597704cf059511a11e22fd3ddc9189e2daaa17b0 Mon Sep 17 00:00:00 2001 From: Vinicius Horewicz Date: Sun, 18 Mar 2012 18:30:29 -0300 Subject: [PATCH] Change permissions and roles --- test/factories/people.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/factories/people.rb b/test/factories/people.rb index 615bbdc..851df9f 100644 --- a/test/factories/people.rb +++ b/test/factories/people.rb @@ -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 \ No newline at end of file