diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-08-23 17:11:49 +0200 |
---|---|---|
committer | Petteri Räty <petsku@petteriraty.eu> | 2010-10-05 22:15:29 +0300 |
commit | 3556deb1eacc5ef81633d9068c043fc680ff5fed (patch) | |
tree | b50d2a384f0365759794f6d1523b721bfd065215 /features | |
parent | gRaphael files (diff) | |
download | recruiting-webapp-3556deb1eacc5ef81633d9068c043fc680ff5fed.tar.gz recruiting-webapp-3556deb1eacc5ef81633d9068c043fc680ff5fed.tar.bz2 recruiting-webapp-3556deb1eacc5ef81633d9068c043fc680ff5fed.zip |
Pie chart on how recruits evaluated documentation on questions how pages
Charts are shown only to recruiters on questions show pages, but other
users may view charts directly (by entering URL manually).
Diffstat (limited to 'features')
-rw-r--r-- | features/documentation_feedback.feature | 25 | ||||
-rw-r--r-- | features/step_definitions/documentation_feedback_steps.rb | 16 |
2 files changed, 41 insertions, 0 deletions
diff --git a/features/documentation_feedback.feature b/features/documentation_feedback.feature new file mode 100644 index 0000000..c792823 --- /dev/null +++ b/features/documentation_feedback.feature @@ -0,0 +1,25 @@ +Feature: Documentation feedback + As recruiter I want to see recruits feedback on questions documentation + But I don't want non-recruiters to see it + + Scenario: When there is feedback see it as recruiter but not as recruit + Given I am logged in as "recruit" + And a question "question" + When I am on show "question" question page + And I follow "Answer it!" + And I select "Documentation Ok" from "answer[feedback]" + And press "Create Answer" + + When I am on show "question" question page + Then I should see no pie chart with feedback + + When I follow "Log out" + And I am logged in as "recruiter" who is "recruiter" + When I am on show "question" question page + Then I should see pie chart with feedback for "question" + + Scenario: Don't see recruits feedback as recruiter when there is none + Given I am logged in as "recruiter" who is "recruiter" + And a question "question" + When I am on show "question" question page + Then I should see no pie chart with feedback diff --git a/features/step_definitions/documentation_feedback_steps.rb b/features/step_definitions/documentation_feedback_steps.rb new file mode 100644 index 0000000..58dcb98 --- /dev/null +++ b/features/step_definitions/documentation_feedback_steps.rb @@ -0,0 +1,16 @@ +Then /^I should see tag <([^<>]*)>$/ do |tag| + /#{tag}/.match(response.body).should_not be_nil +end + +Then /^I should not see tag <([^<>]*)>$/ do |tag| + /#{tag}/.match(response.body).should be_nil +end + +Then /^I should see pie chart with feedback for "([^"]*)"$/ do |question| + Given "a question \"#{question}\"" + Then "I should see tag <iframe src=\"/questions/#{@question.id}/doc_feedback_chart\">" +end + +Then /^I should see no pie chart with feedback$/ do + Then 'I should not see tag <iframe src="/questions/\d+/doc_feedback_chart">' +end |