aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-30 13:25:04 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-31 12:29:39 +0200
commit7ab46eafb0124576a9bc1a91d314507b42d91ef5 (patch)
tree0947b61261332562a029f09a25368545a54a14eb
parentMake users with empty nick and openid valid (diff)
downloadrecruiting-webapp-7ab46eafb0124576a9bc1a91d314507b42d91ef5.tar.gz
recruiting-webapp-7ab46eafb0124576a9bc1a91d314507b42d91ef5.tar.bz2
recruiting-webapp-7ab46eafb0124576a9bc1a91d314507b42d91ef5.zip
Show question content when creating or editing answer
Fix bug: https://bugs.gentoo.org/show_bug.cgi?id=356847
-rw-r--r--app/views/answers/new_for_question.dryml1
-rw-r--r--features/answer_text_question.feature13
-rw-r--r--features/step_definitions/within_steps.rb3
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|