From 7ab46eafb0124576a9bc1a91d314507b42d91ef5 Mon Sep 17 00:00:00 2001 From: Joachim Filip Ignacy Bartosik Date: Mon, 30 May 2011 13:25:04 +0200 Subject: Show question content when creating or editing answer Fix bug: https://bugs.gentoo.org/show_bug.cgi?id=356847 --- app/views/answers/new_for_question.dryml | 1 + features/answer_text_question.feature | 13 +++++++++++++ features/step_definitions/within_steps.rb | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/views/answers/new_for_question.dryml b/app/views/answers/new_for_question.dryml index 81f8f8f..f949dc1 100644 --- a/app/views/answers/new_for_question.dryml +++ b/app/views/answers/new_for_question.dryml @@ -1,6 +1,7 @@ <%# Form Hobo inserts by default is broken, because it asks for owner%> +
diff --git a/features/answer_text_question.feature b/features/answer_text_question.feature index 37f9a8b..4278f4d 100644 --- a/features/answer_text_question.feature +++ b/features/answer_text_question.feature @@ -33,3 +33,16 @@ Feature: Answering text question And I fill in "Some question." for "question_content_text[content]" And press "Save" Then I should see "Changes to the question content text were saved" within ".flash.notice" + + Scenario: See question content when creating new answer + Given text content "some question" for question "question" + And I am logged in as "recruit" + When I am on show "question" question page + And I follow "Answer it!" + Then I should see "fake" as question content + + Scenario: See question content when editing answer + Given answer of "recruit" for question "example question" + And I am logged in as "recruit" + When I am on answer of "recruit" for question "example question" page + Then I should see "fake" as question content diff --git a/features/step_definitions/within_steps.rb b/features/step_definitions/within_steps.rb index 3a3822d..e2eb67f 100644 --- a/features/step_definitions/within_steps.rb +++ b/features/step_definitions/within_steps.rb @@ -1,5 +1,6 @@ { - 'as a role' => '.role-tag.view.user-role' + 'as a role' => '.role-tag.view.user-role', + 'as question content' => '.view.question-content' }. each do |within, selector| Then /^I should( not)? see "([^"]*)" #{within}$/ do |negation, text| -- cgit v1.2.3-65-gdbad