public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/recruiting-webapp:master commit in: app/views/users/, features/, features/step_definitions/
@ 2011-07-13 16:01 Petteri Räty
  0 siblings, 0 replies; only message in thread
From: Petteri Räty @ 2011-07-13 16:01 UTC (permalink / raw
  To: gentoo-commits

commit:     13bd8ae505d4d35ff792ce00c7b4bc676a38f817
Author:     Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
AuthorDate: Sat Jul  9 17:14:05 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat Jul  9 17:16:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git;a=commit;h=13bd8ae5

Show note about editing mentor relation on user edit page

---
 app/views/users/edit.dryml                  |   11 ++++++++++-
 features/clean_ui.feature                   |   17 +++++++++++++++++
 features/step_definitions/clean_ui_steps.rb |   16 ++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/app/views/users/edit.dryml b/app/views/users/edit.dryml
index f974b53..7a0698e 100644
--- a/app/views/users/edit.dryml
+++ b/app/views/users/edit.dryml
@@ -1,4 +1,13 @@
-<edit-page if="&current_user.valid?" />
+<edit-page if="&current_user.valid?">
+  <prepend-content-body:>
+    <div if="&can_edit?(:mentor)">
+      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.
+    </div>
+    <else>
+      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).
+    </else>
+  </prepend-content-body:>
+</edit-page>
 <else>
   <edit-page>
     <body:>

diff --git a/features/clean_ui.feature b/features/clean_ui.feature
index df2ec9f..fd11103 100644
--- a/features/clean_ui.feature
+++ b/features/clean_ui.feature
@@ -108,3 +108,20 @@ Feature: Clean UI
     When I am logged in as "recruit"
     And I am on answer of "recruit" for question "question" page
     Then I should not see "(Not Available)"
+
+  Scenario: Show message telling how to start mentoring recruit on user edit page
+    Given I am logged in as "mentor" who is "mentor"
+    And user "recruit" who is "recruit"
+    Then I should see instructions on becoming mentor for "recruit"
+
+  Scenario: Show message telling how to start mentoring recruit on user edit page
+    Given user "recruit" who is "recruit"
+    Then I should see explanation that I can't become mentor for "recruit"
+
+    Given I am logged in as "recruit2" who is "recruit"
+    Then I should see explanation that I can't become mentor for "recruit"
+
+    When I follow "Log out"
+    Given I am logged in as "mentor" who is "mentor"
+    And user "mentor2" is mentor of "recruit"
+    Then I should see explanation that I can't become mentor for "recruit"

diff --git a/features/step_definitions/clean_ui_steps.rb b/features/step_definitions/clean_ui_steps.rb
new file mode 100644
index 0000000..5b4501b
--- /dev/null
+++ b/features/step_definitions/clean_ui_steps.rb
@@ -0,0 +1,16 @@
+Then /^I should see instructions on becoming mentor for "([^\"]*)"$/ do |user|
+    When "I am on edit \"#{user}\" user page"
+    Then "I should see \"If you want to start or stop mentoring this recruit " +
+          "go back to show page for this user and click 'Start/Stop mentoring " +
+          "this recruit' button.\""
+
+    When 'I follow "show page for this user"'
+    Then "I should be on show \"#{user}\" user page"
+end
+
+Then /^I should see explanation that I can't become mentor for "([^\"]*)"$/ do |user|
+    When "I am on edit \"#{user}\" user page"
+    Then "I should see \"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).\""
+end



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-13 16:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13 16:01 [gentoo-commits] proj/recruiting-webapp:master commit in: app/views/users/, features/, features/step_definitions/ 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