From 13bd8ae505d4d35ff792ce00c7b4bc676a38f817 Mon Sep 17 00:00:00 2001 From: Joachim Filip Ignacy Bartosik Date: Sat, 9 Jul 2011 19:14:05 +0200 Subject: 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 deletion(-) create mode 100644 features/step_definitions/clean_ui_steps.rb 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 @@ - + + +
+ 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. +
+ + 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). + +
+
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 -- cgit v1.2.3-65-gdbad