big start on QuizStatus
This commit is contained in:
59
test/workers/quiz_status_test.rb
Normal file
59
test/workers/quiz_status_test.rb
Normal file
@ -0,0 +1,59 @@
|
||||
require 'test_helper'
|
||||
|
||||
class QuizStatusTest < ActiveSupport::TestCase
|
||||
test "roy has started test" do
|
||||
roy = candidates :roy
|
||||
status = QuizStatus.new roy
|
||||
|
||||
assert status.started
|
||||
end
|
||||
|
||||
test "martha has NOT started test" do
|
||||
martha = candidates :martha
|
||||
status = QuizStatus.new martha
|
||||
|
||||
refute status.started
|
||||
end
|
||||
|
||||
test "dawn is on summary page" do
|
||||
dawn = candidates :dawn
|
||||
status = QuizStatus.new dawn
|
||||
|
||||
assert status.on_summary
|
||||
end
|
||||
|
||||
test "roy is NOT on summary" do
|
||||
roy = candidates :roy
|
||||
status = QuizStatus.new roy
|
||||
|
||||
refute status.on_summary
|
||||
end
|
||||
|
||||
test "roy has NOT submitted" do
|
||||
roy = candidates :roy
|
||||
status = QuizStatus.new roy
|
||||
|
||||
refute status.completed
|
||||
end
|
||||
|
||||
test "richard is complete" do
|
||||
richard = candidates :richard
|
||||
status = QuizStatus.new richard
|
||||
|
||||
assert status.completed
|
||||
end
|
||||
|
||||
test "dawn can NOT submit" do
|
||||
dawn = candidates :dawn
|
||||
status = QuizStatus.new dawn
|
||||
|
||||
refute status.can_submit
|
||||
end
|
||||
|
||||
test "richard can submit" do
|
||||
richard = candidates :richard
|
||||
status = QuizStatus.new richard
|
||||
|
||||
assert status.can_submit
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user