-
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.
- Loading branch information
Justin Camerer
committed
May 8, 2008
1 parent
1d74ab0
commit 8f89913
Showing
46 changed files
with
1,256 additions
and
414 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
require File.dirname(__FILE__) + '/../config/boot' | ||
require 'commands/dbconsole' |
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,58 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
# Be sure to include AuthenticatedTestHelper in spec/spec_helper.rb instead | ||
# Then, you can remove it from this and the units test. | ||
include AuthenticatedTestHelper | ||
|
||
describe UsersController do | ||
fixtures :users | ||
fixtures :roles | ||
|
||
describe 'when logged in as an admin' do | ||
before(:each) do | ||
login_as(:iamjwc) | ||
end | ||
|
||
it 'should display a list of the users' do | ||
get :index | ||
response.should_not be_redirect | ||
end | ||
|
||
it 'should be able to create new users' do | ||
lambda do | ||
create_user | ||
response.should be_redirect | ||
end.should change(User, :count).by(1) | ||
end | ||
|
||
it 'should be able to suspend and unsuspend a user' do | ||
user = users(:activated) | ||
user.suspended?.should be_false | ||
|
||
put :suspend, :id => user.id | ||
|
||
user.reload | ||
user.suspended?.should be_true | ||
|
||
put :unsuspend, :id => user.id | ||
|
||
user.reload | ||
user.suspended?.should be_false | ||
end | ||
|
||
it 'should be able to send a user a password reset code' do | ||
user = users(:activated) | ||
user.password_reset_code.should be_nil | ||
|
||
put :reset_password, :id => user.id | ||
|
||
user.reload | ||
user.password_reset_code.should_not be_nil | ||
end | ||
end | ||
|
||
def create_user(options = {}) | ||
post :create, :user => { :login => 'quire', :email => 'quire@example.com', | ||
:password => 'quire', :password_confirmation => 'quire' }.merge(options) | ||
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
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
Oops, something went wrong.