diff options
-rw-r--r-- | app/views/answers/new_for_question.dryml | 1 | ||||
-rw-r--r-- | features/answer_text_question.feature | 13 | ||||
-rw-r--r-- | features/step_definitions/within_steps.rb | 3 |
3 files changed, 16 insertions, 1 deletions
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%> <new-for-question-page> <content-body:> + <view:question.content/> <form with="&this.question.content.new_answer_of(current_user)" action="&create_answer_path"> <submit: label="#{ht 'answers.actions.create', :default=>['Create Answer']}"/> </form> 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| |