Skip to content

Commit

Permalink
Don't show "Start mentoring this recruit" button on non-recruit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jbartosik committed Jul 23, 2011
1 parent f98b192 commit 94f2ab8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/users/show.dryml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<actions:><submit label="This recruit needs your acceptance"/></actions:>
</form>

<if test="&this.editable_by?(current_user, :mentor)">
<if test="&this.editable_by?(current_user, :mentor) and this.role.is_recruit?">
<form if="&this.mentor.nil?">
<input value="&current_user.id" type="hidden" name="user[mentor_id]"/>
<submit label="Start mentoring this recruit"/>
Expand Down
7 changes: 7 additions & 0 deletions features/clean_ui.feature
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,10 @@ Feature: Clean UI
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"


Scenario: Don't show "recruit this recruit" button on non-recruit pages
Given I am logged in as "recruiter" who is "recruiter"
And user "recruiter2" who is "recruiter"
When I am on show "recruiter2" user page
Then I should not see tag <input class="button submit-button" type="submit" value="Start mentoring this recruit">

0 comments on commit 94f2ab8

Please sign in to comment.