Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/recruiting-webapp:master commit in: app/views/users/, features/, features/step_definitions/
Date: Wed, 13 Jul 2011 16:01:57
Message-Id: 13bd8ae505d4d35ff792ce00c7b4bc676a38f817.betelgeuse@gentoo
1 commit: 13bd8ae505d4d35ff792ce00c7b4bc676a38f817
2 Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
3 AuthorDate: Sat Jul 9 17:14:05 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 9 17:16:49 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git;a=commit;h=13bd8ae5
7
8 Show note about editing mentor relation on user edit page
9
10 ---
11 app/views/users/edit.dryml | 11 ++++++++++-
12 features/clean_ui.feature | 17 +++++++++++++++++
13 features/step_definitions/clean_ui_steps.rb | 16 ++++++++++++++++
14 3 files changed, 43 insertions(+), 1 deletions(-)
15
16 diff --git a/app/views/users/edit.dryml b/app/views/users/edit.dryml
17 index f974b53..7a0698e 100644
18 --- a/app/views/users/edit.dryml
19 +++ b/app/views/users/edit.dryml
20 @@ -1,4 +1,13 @@
21 -<edit-page if="&current_user.valid?" />
22 +<edit-page if="&current_user.valid?">
23 + <prepend-content-body:>
24 + <div if="&can_edit?(:mentor)">
25 + If you want to start or stop mentoring this recruit go back to <a>show page for this user</a> and click 'Start/Stop mentoring this recruit' button.
26 + </div>
27 + <else>
28 + You can not change mentor for this user (possible reasons are: you're not logged in, you don't have mentor role, someone else is mentor for this user).
29 + </else>
30 + </prepend-content-body:>
31 +</edit-page>
32 <else>
33 <edit-page>
34 <body:>
35
36 diff --git a/features/clean_ui.feature b/features/clean_ui.feature
37 index df2ec9f..fd11103 100644
38 --- a/features/clean_ui.feature
39 +++ b/features/clean_ui.feature
40 @@ -108,3 +108,20 @@ Feature: Clean UI
41 When I am logged in as "recruit"
42 And I am on answer of "recruit" for question "question" page
43 Then I should not see "(Not Available)"
44 +
45 + Scenario: Show message telling how to start mentoring recruit on user edit page
46 + Given I am logged in as "mentor" who is "mentor"
47 + And user "recruit" who is "recruit"
48 + Then I should see instructions on becoming mentor for "recruit"
49 +
50 + Scenario: Show message telling how to start mentoring recruit on user edit page
51 + Given user "recruit" who is "recruit"
52 + Then I should see explanation that I can't become mentor for "recruit"
53 +
54 + Given I am logged in as "recruit2" who is "recruit"
55 + Then I should see explanation that I can't become mentor for "recruit"
56 +
57 + When I follow "Log out"
58 + Given I am logged in as "mentor" who is "mentor"
59 + And user "mentor2" is mentor of "recruit"
60 + Then I should see explanation that I can't become mentor for "recruit"
61
62 diff --git a/features/step_definitions/clean_ui_steps.rb b/features/step_definitions/clean_ui_steps.rb
63 new file mode 100644
64 index 0000000..5b4501b
65 --- /dev/null
66 +++ b/features/step_definitions/clean_ui_steps.rb
67 @@ -0,0 +1,16 @@
68 +Then /^I should see instructions on becoming mentor for "([^\"]*)"$/ do |user|
69 + When "I am on edit \"#{user}\" user page"
70 + Then "I should see \"If you want to start or stop mentoring this recruit " +
71 + "go back to show page for this user and click 'Start/Stop mentoring " +
72 + "this recruit' button.\""
73 +
74 + When 'I follow "show page for this user"'
75 + Then "I should be on show \"#{user}\" user page"
76 +end
77 +
78 +Then /^I should see explanation that I can't become mentor for "([^\"]*)"$/ do |user|
79 + When "I am on edit \"#{user}\" user page"
80 + Then "I should see \"You can not change mentor for this user (possible " +
81 + "reasons are: you're not logged in, you don't have mentor role, " +
82 + "someone else is mentor for this user).\""
83 +end