* [gentoo-commits] proj/recruiting-webapp:master commit in: features/, features/step_definitions/, app/views/answers/
@ 2011-06-02 17:18 Petteri Räty
0 siblings, 0 replies; only message in thread
From: Petteri Räty @ 2011-06-02 17:18 UTC (permalink / raw
To: gentoo-commits
commit: 7ab46eafb0124576a9bc1a91d314507b42d91ef5
Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
AuthorDate: Mon May 30 11:25:04 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue May 31 10:29:39 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git;a=commit;h=7ab46eaf
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 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|
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-02 17:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-02 17:18 [gentoo-commits] proj/recruiting-webapp:master commit in: features/, features/step_definitions/, app/views/answers/ Petteri Räty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox