aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-08-13 18:12:40 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-08-16 13:35:14 +0200
commit74eb8f0171e7eb6771c81de67477605e88eb6aa9 (patch)
treecfeba10b039ea4a10f9786d0b1e886947b22e24f
parentMove Role where it belongs to app/rich_types (diff)
downloadrecruiting-webapp-74eb8f0171e7eb6771c81de67477605e88eb6aa9.tar.gz
recruiting-webapp-74eb8f0171e7eb6771c81de67477605e88eb6aa9.tar.bz2
recruiting-webapp-74eb8f0171e7eb6771c81de67477605e88eb6aa9.zip
One-click way to start or stop mentoring recruit
-rw-r--r--app/views/users/show.dryml12
-rw-r--r--features/request_mentor.feature13
2 files changed, 21 insertions, 4 deletions
diff --git a/app/views/users/show.dryml b/app/views/users/show.dryml
index 3cd38d1..b7bd5fe 100644
--- a/app/views/users/show.dryml
+++ b/app/views/users/show.dryml
@@ -14,5 +14,17 @@
<field-list: skip="user, accepting_nick, accepted"/>
<actions:><submit label="This recruit needs your acceptance"/></actions:>
</form>
+
+ <if test="&this.editable_by?(current_user, :mentor)">
+ <form if="&this.mentor.nil?">
+ <input value="&current_user.id" type="hidden" name="user[mentor_id]"/>
+ <submit label="Start mentoring this recruit"/>
+ </form>
+
+ <form if="&this.mentor_is?(current_user)">
+ <input value="" type="hidden" name="user[mentor_id]"/>
+ <submit label="Stop mentoring this recruit"/>
+ </form>
+ </if>
</append-aside:>
</show-page>
diff --git a/features/request_mentor.feature b/features/request_mentor.feature
index 01e550e..1e5631f 100644
--- a/features/request_mentor.feature
+++ b/features/request_mentor.feature
@@ -22,10 +22,15 @@ Feature: Request Mentor
And I should see "recruit1" within ".collection.users"
But I should not see "recruit3" within ".collection.users"
- Scenario: Become mentor of mentorless recruit
+ Scenario: Become mentor of mentorless recruit then stop mentoring
Given I am logged in as "mentor" who is "mentor"
And user "recruit" who is "recruit"
- And I am on edit "recruit" user page
- When I select "mentor" from "user[mentor_id]"
- And press "Save"
+ And I am on show "recruit" user page
+ When I press "Start mentoring this recruit"
+ Then I should see "Changes to the user were saved" within ".flash.notice"
+ And I should see "Mentor mentor"
+
+ And I am on show "recruit" user page
+ When I press "Stop mentoring this recruit"
Then I should see "Changes to the user were saved" within ".flash.notice"
+ And I should see "Mentor (Not Available) "