forked from rapidftr/RapidFTR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notifies admin user about password recovery requests.
Admin is able to hide notifications.
- Loading branch information
Showing
9 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<% if is_admin? %> | ||
<% @notifications = PasswordRecoveryRequest.to_display %> | ||
<% unless @notifications.empty? %> | ||
<p>These users requested password reset. Please contact them immediatly.<ul> | ||
<ul> | ||
<% @notifications.each do |notification| %> | ||
<li><%= "#{notification.user_name} at #{time_ago_in_words notification.created_at} ago #{link_to("hide", hide_password_recovery_request_path(notification), :method => :delete)}" %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
describe Login do | ||
describe "validation" do | ||
it "" do | ||
password_recovery_request = PasswordRecoveryRequest.new :user_name => "" | ||
password_recovery_request.should_not be_valid | ||
describe PasswordRecoveryRequest do | ||
context 'a new request' do | ||
before do | ||
@request = PasswordRecoveryRequest.new :user_name => "duck" | ||
@request.save | ||
end | ||
it "should tell new requests that were not hidden" do | ||
PasswordRecoveryRequest.to_display.should =~ [ @request ] | ||
end | ||
context 'hiding a request' do | ||
before { @request.hide! } | ||
it 'should not be displayed' do | ||
PasswordRecoveryRequest.to_display.should =~ [] | ||
end | ||
end | ||
end | ||
end |