1 |
commit: 7ab46eafb0124576a9bc1a91d314507b42d91ef5 |
2 |
Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon May 30 11:25:04 2011 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 31 10:29:39 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git;a=commit;h=7ab46eaf |
7 |
|
8 |
Show question content when creating or editing answer |
9 |
|
10 |
Fix bug: |
11 |
https://bugs.gentoo.org/show_bug.cgi?id=356847 |
12 |
|
13 |
--- |
14 |
app/views/answers/new_for_question.dryml | 1 + |
15 |
features/answer_text_question.feature | 13 +++++++++++++ |
16 |
features/step_definitions/within_steps.rb | 3 ++- |
17 |
3 files changed, 16 insertions(+), 1 deletions(-) |
18 |
|
19 |
diff --git a/app/views/answers/new_for_question.dryml b/app/views/answers/new_for_question.dryml |
20 |
index 81f8f8f..f949dc1 100644 |
21 |
--- a/app/views/answers/new_for_question.dryml |
22 |
+++ b/app/views/answers/new_for_question.dryml |
23 |
@@ -1,6 +1,7 @@ |
24 |
<%# Form Hobo inserts by default is broken, because it asks for owner%> |
25 |
<new-for-question-page> |
26 |
<content-body:> |
27 |
+ <view:question.content/> |
28 |
<form with="&this.question.content.new_answer_of(current_user)" action="&create_answer_path"> |
29 |
<submit: label="#{ht 'answers.actions.create', :default=>['Create Answer']}"/> |
30 |
</form> |
31 |
|
32 |
diff --git a/features/answer_text_question.feature b/features/answer_text_question.feature |
33 |
index 37f9a8b..4278f4d 100644 |
34 |
--- a/features/answer_text_question.feature |
35 |
+++ b/features/answer_text_question.feature |
36 |
@@ -33,3 +33,16 @@ Feature: Answering text question |
37 |
And I fill in "Some question." for "question_content_text[content]" |
38 |
And press "Save" |
39 |
Then I should see "Changes to the question content text were saved" within ".flash.notice" |
40 |
+ |
41 |
+ Scenario: See question content when creating new answer |
42 |
+ Given text content "some question" for question "question" |
43 |
+ And I am logged in as "recruit" |
44 |
+ When I am on show "question" question page |
45 |
+ And I follow "Answer it!" |
46 |
+ Then I should see "fake" as question content |
47 |
+ |
48 |
+ Scenario: See question content when editing answer |
49 |
+ Given answer of "recruit" for question "example question" |
50 |
+ And I am logged in as "recruit" |
51 |
+ When I am on answer of "recruit" for question "example question" page |
52 |
+ Then I should see "fake" as question content |
53 |
|
54 |
diff --git a/features/step_definitions/within_steps.rb b/features/step_definitions/within_steps.rb |
55 |
index 3a3822d..e2eb67f 100644 |
56 |
--- a/features/step_definitions/within_steps.rb |
57 |
+++ b/features/step_definitions/within_steps.rb |
58 |
@@ -1,5 +1,6 @@ |
59 |
{ |
60 |
- 'as a role' => '.role-tag.view.user-role' |
61 |
+ 'as a role' => '.role-tag.view.user-role', |
62 |
+ 'as question content' => '.view.question-content' |
63 |
}. |
64 |
each do |within, selector| |
65 |
Then /^I should( not)? see "([^"]*)" #{within}$/ do |negation, text| |