diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-07-09 19:14:05 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-07-09 19:16:49 +0200 |
commit | 13bd8ae505d4d35ff792ce00c7b4bc676a38f817 (patch) | |
tree | 55875ae7aa19d1bb7a64d0ffce8796fdd304a2de | |
parent | Production email configs (diff) | |
download | recruiting-webapp-13bd8ae505d4d35ff792ce00c7b4bc676a38f817.tar.gz recruiting-webapp-13bd8ae505d4d35ff792ce00c7b4bc676a38f817.tar.bz2 recruiting-webapp-13bd8ae505d4d35ff792ce00c7b4bc676a38f817.zip |
Show note about editing mentor relation on user edit page
-rw-r--r-- | app/views/users/edit.dryml | 11 | ||||
-rw-r--r-- | features/clean_ui.feature | 17 | ||||
-rw-r--r-- | 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="¤t_user.valid?" /> +<edit-page if="¤t_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 |