Submit summary

This commit is contained in:
Derek Montgomery
2016-08-02 16:27:27 -05:00
parent 988f1346c1
commit 7bdb86f89f
6 changed files with 135 additions and 14 deletions

View File

@ -57,11 +57,22 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
assert_equal qid, flash[:answer_error]
end
test "should send mailers on submission" do
test "should NOT send mailers on submission" do
setup_auth candidates(:dawn)
assert_difference("ActionMailer::Base.deliveries.size", 0) do
post post_summary_path
end
assert_redirected_to summary_path
assert_match 'must complete', flash[:error]
end
test "should send mailers on submission" do
setup_auth candidates(:peggy)
assert_difference("ActionMailer::Base.deliveries.size", 3) do
post post_summary_path
end
assert_redirected_to thankyou_path
end
end

View File

@ -108,6 +108,97 @@ dawn10:
created_at: <%= DateTime.now() - 38.hours - 40.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 20.minutes %>
peggy1:
candidate: peggy
question: fed1
answer: option-1
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 50.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 50.minutes %>
peggy2:
candidate: peggy
question: fed2
answer: ["option2", "option-4"]
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 50.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 50.minutes %>
peggy3:
candidate: peggy
question: fed3
answer: {html: "peggy3 <h1>I'm a little tealpot</h1>", css: 'h1 {color: teal;}', js: ''}
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 50.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 50.minutes %>
peggy4:
candidate: peggy
question: fed4
answer: Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis.
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 50.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 50.minutes %>
peggy5:
candidate: peggy
question: fed5
answer: "option 3"
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 50.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 50.minutes %>
peggy6:
candidate: peggy
question: fed6
answer: Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 32.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 12.minutes %>
peggy7:
candidate: peggy
question: fed7
answer: {html: 'peggy7 <p>This means <strong>jQuery</strong> needs to be available in live-coder!</p>', css: "strong {font-size: 1.6em;}\n.green {color: green;}", js: '$("strong").addClass("green");'}
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 34.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 14.minutes %>
peggy8:
candidate: peggy
question: fed8
answer: option2
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 38.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 16.minutes %>
peggy9:
candidate: peggy
question: fed9
answer: Grunt
saved: 0
submitted: true
created_at: <%= DateTime.now() - 38.hours - 38.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 18.minutes %>
peggy10:
candidate: peggy
question: fed10
answer: ["Live long and prosper", "Who you calling Scruffy?"]
saved: 1
submitted: true
created_at: <%= DateTime.now() - 38.hours - 40.minutes %>
updated_at: <%= DateTime.now() - 38.hours - 20.minutes %>
richard1:
candidate: richard
question: fed1
@ -197,4 +288,3 @@ richard10:
submitted: true
created_at: <%= DateTime.now() - 36.hours - 40.minutes %>
updated_at: <%= DateTime.now() - 36.hours - 20.minutes %>

View File

@ -30,6 +30,16 @@ dawn:
reminded: true
test_hash: OvP0ZqGKwJ0
peggy:
name: Peggy Blisters
email: peggy.blisters@mailinator.com
experience: 0-2
recruiter: recruiter
quiz: fed
completed: false
reminded: true
test_hash: 242a9d5d085
richard:
name: Richard Burns
email: richard.burns@mailinator.com