diff --git a/test/controllers/admin/candidate_controller/index_test.rb b/test/controllers/admin/candidate_controller/index_test.rb index cd6ebe0..d14ef40 100644 --- a/test/controllers/admin/candidate_controller/index_test.rb +++ b/test/controllers/admin/candidate_controller/index_test.rb @@ -25,7 +25,7 @@ module Admin auth_recruiter get admin_candidates_url assert_response :success - assert_select "a[href='#{admin_edit_candidate_path(candidates(:martha))}']" + assert_select "a[href='#{admin_edit_candidate_path(candidates(:gillian))}']" end end end diff --git a/test/fixtures/answers.yml b/test/fixtures/answers.yml index 69019e2..de1b7be 100644 --- a/test/fixtures/answers.yml +++ b/test/fixtures/answers.yml @@ -698,8 +698,8 @@ wade10: jorge1: candidate: jorge - question: Cras justo odio, dapibus ac facilisis in, egestas eget quam. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. - answer: option 3 + question: fed1 + answer: Cras justo odio, dapibus ac facilisis in, egestas eget quam. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. saved: 0 submitted: true created_at: <%= DateTime.now() - 36.hours - 22.minutes %> @@ -890,3 +890,87 @@ elsie10: created_at: <%= DateTime.now() - 36.hours - 40.minutes %> updated_at: <%= DateTime.now() - 36.hours - 20.minutes %> + +########################## +############# Studio Quiz +ethan1: + candidate: ethan + question: studio1 + answer: Cras justo odio, dapibus ac facilisis in, egestas eget quam. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 36.hours - 22.minutes %> + updated_at: <%= DateTime.now() - 36.hours - 22.minutes %> + +ethan2: + candidate: ethan + question: studio2 + answer: Vestibulum id ligula porta felis euismod semper. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 36.hours - 24.minutes %> + updated_at: <%= DateTime.now() - 36.hours - 4.minutes %> + +ethan3: + candidate: ethan + question: studio3 + answer: Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nulla vitae elit libero, a pharetra augue. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 36.hours - 26.minutes %> + updated_at: <%= DateTime.now() - 36.hours - 6.minutes %> + +adele1: + candidate: adele + question: studio1 + answer: Cras justo odio, dapibus ac facilisis in, egestas eget quam. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 16.hours - 22.minutes %> + updated_at: <%= DateTime.now() - 16.hours - 22.minutes %> + +adele2: + candidate: adele + question: studio2 + answer: Vestibulum id ligula porta felis euismod semper. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 16.hours - 24.minutes %> + updated_at: <%= DateTime.now() - 16.hours - 4.minutes %> + +adele3: + candidate: adele + question: studio3 + answer: Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nulla vitae elit libero, a pharetra augue. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 16.hours - 26.minutes %> + updated_at: <%= DateTime.now() - 16.hours - 6.minutes %> + +carl1: + candidate: carl + question: studio1 + answer: Cras justo odio, dapibus ac facilisis in, egestas eget quam. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 22.minutes %> + updated_at: <%= DateTime.now() - 22.minutes %> + +carl2: + candidate: carl + question: studio2 + answer: Vestibulum id ligula porta felis euismod semper. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 24.minutes %> + updated_at: <%= DateTime.now() - 4.minutes %> + +carl3: + candidate: carl + question: studio3 + answer: Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nulla vitae elit libero, a pharetra augue. + saved: 0 + submitted: true + created_at: <%= DateTime.now() - 26.minutes %> + updated_at: <%= DateTime.now() - 6.minutes %> + diff --git a/test/fixtures/candidates.yml b/test/fixtures/candidates.yml index d298cc5..0e70cec 100644 --- a/test/fixtures/candidates.yml +++ b/test/fixtures/candidates.yml @@ -179,3 +179,42 @@ gustov: # Gustov is NOT for FED reminded: false test_hash: kp6tfghjyapJnkz2N +ethan: # Completed quiz for studio + name: Ethan Woodward + email: <%= CryptSerializer.dump 'ethan.woodward@mailinator.com' %> + experience: 0-3 + project: Studio Client + position: 'full-time' + skill_needs: 'Angular, HTML' + recruiter: recruiter + quiz: studio + completed: true + reminded: false + test_hash: vNgQo2c5/HZL2CN + +adele: # Completed quiz for studio + name: Adele Kearney + email: <%= CryptSerializer.dump 'adele.kearney@mailinator.com' %> + experience: 0-3 + project: Studio Client + position: 'full-time' + skill_needs: 'Angular, HTML' + recruiter: recruiter + quiz: studio + completed: true + reminded: false + test_hash: 37GmHL0Odjwv + +carl: # Completed quiz for studio + name: Carl Mitchell + email: <%= CryptSerializer.dump 'carle.mitchell@mailinator.com' %> + experience: 0-3 + project: Studio Client + position: 'full-time' + skill_needs: 'Angular, HTML' + recruiter: recruiter + quiz: studio + completed: true + reminded: false + test_hash: hANPsTL1XHcmi + diff --git a/test/fixtures/questions.yml b/test/fixtures/questions.yml index 4380750..33a23f7 100644 --- a/test/fixtures/questions.yml +++ b/test/fixtures/questions.yml @@ -150,3 +150,32 @@ admin1: sort: 0 active: true + +studio1: + quiz: studio + question: 'Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum.' + category: Ipsum + input_type: text + input_options: + sort: 0 + active: true + +studio2: + quiz: studio + question: 'Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum.' + category: Magna + input_type: text + input_options: + sort: 0 + active: true + + +studio3: + quiz: studio + question: 'Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum.' + category: Commodo + input_type: text + input_options: + sort: 0 + active: true + diff --git a/test/fixtures/quizzes.yml b/test/fixtures/quizzes.yml index f4bd5fa..5f4aa1d 100644 --- a/test/fixtures/quizzes.yml +++ b/test/fixtures/quizzes.yml @@ -1,11 +1,16 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html fed: - name: PDR Standard FED Screening - unit: PDR + name: PDA Standard FED Screening + unit: PD Agency dept: FED admin: name: An extra quiz not assigned to anyone - unit: PDR + unit: PD dept: NOPE + +studio: + name: Studio Screening One + unit: PD Studio + dept: FED diff --git a/test/fixtures/reviewer_to_quizzes.yml b/test/fixtures/reviewer_to_quizzes.yml index cb91027..45b4b22 100644 --- a/test/fixtures/reviewer_to_quizzes.yml +++ b/test/fixtures/reviewer_to_quizzes.yml @@ -11,3 +11,11 @@ two: three: user: manager quiz: fed + +four: + user: studio_manager + quiz: studio + +five: + user: studio_reviewer + quiz: studio diff --git a/test/fixtures/reviewer_votes.yml b/test/fixtures/reviewer_votes.yml index a8ab4c1..440ac4b 100644 --- a/test/fixtures/reviewer_votes.yml +++ b/test/fixtures/reviewer_votes.yml @@ -93,3 +93,29 @@ reviewer2_elsie: candidate: elsie user: reviewer2 + +studio_reviewer_carle: + candidate: carle + user: studio_reviewer + +studio_reviewer_ethan: + candidate: ethan + user: studio_reviewer + +studio_reviewer_adele: + candidate: adele + user: studio_reviewer + + +studio_manager_carle: + candidate: carle + user: studio_manager + +studio_manager_ethan: + candidate: ethan + user: studio_manager + +studio_manager_adele: + user: studio_manager + candidate: adele + diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 94e21e3..9e55556 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -29,3 +29,16 @@ admin: email: alan.admin@mailinator.com password_digest: <%= BCrypt::Password.create("password", cost: 4) %> role: admin + +studio_manager: + name: Studio Manager + email: studio.manager@mailinator.com + password_digest: <%= BCrypt::Password.create("password", cost: 4) %> + role: manager + +studio_reviewer: + name: Studio Reviewer + email: studio.reviewer@mailinator.com + password_digest: <%= BCrypt::Password.create("password", cost: 4) %> + role: reviewer + diff --git a/test/models/reviewer_vote_test.rb b/test/models/reviewer_vote_test.rb index d5a9ef3..2ea670c 100644 --- a/test/models/reviewer_vote_test.rb +++ b/test/models/reviewer_vote_test.rb @@ -14,7 +14,7 @@ class ReviewerVoteTest < ActiveSupport::TestCase test "manager has a vote for every completed quiz" do manager = users(:manager) - completed_count = Candidate.where(completed: true).count + completed_count = 6 assert_equal completed_count, manager.votes.size end diff --git a/test/workers/reviewer_reminder_test.rb b/test/workers/reviewer_reminder_test.rb index c4399dd..5a6cbf0 100644 --- a/test/workers/reviewer_reminder_test.rb +++ b/test/workers/reviewer_reminder_test.rb @@ -4,7 +4,7 @@ require 'test_helper' class ReviewerReminderTest < ActiveSupport::TestCase test "collection is created with results" do reminders = ReviewerReminder.new - assert_equal 6, reminders.size + assert_equal 8, reminders.size end test "each reminder has needed attributes" do