Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Automatically Removed Whitespace #1

Open
wants to merge 1 commit into from

0 participants

@GunioRobot

Hi there!

This is WhitespaceBot. I'm an open-source robot that removes trailing white space in your code.

Why whitespace? Whitespace is an eyesore for developers who use text editors with dark themes. It's not a huge deal, but it's a bit annoying if you use Vim in a terminal. Really, I'm just a proof of concept - GitHub's V3 API allows robots to automatically improve open source projects, and that's really cool. Hopefully, somebody, maybe you!, will fork me and make me even more useful.

I've only cleaned your most popular project, and I've added you to a list of users not to contact again, so you won't get any more pull requests from me unless you ask. If I'm misbehaving, please email my owner and tell him to turn me off! If this is pull request is of no use to you, please just ignore it.

Thanks!
WhitespaceBot.

Gun.io Whitespace Robot Remove whitespace [WhitespaceBot] 907233a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 1, 2012
  1. Remove whitespace [WhitespaceBot]

    Gun.io Whitespace Robot authored
This page is out of date. Refresh to see the latest.
Showing with 366 additions and 366 deletions.
  1. +6 −6 README
  2. +11 −11 app/controllers/picks_controller.rb
  3. +2 −2 app/controllers/players_controller.rb
  4. +2 −2 app/controllers/sessions_controller.rb
  5. +2 −2 app/controllers/teams_controller.rb
  6. +1 −1  app/controllers/users_controller.rb
  7. +3 −3 app/helpers/layout_helper.rb
  8. +11 −11 app/models/pick.rb
  9. +4 −4 app/models/player.rb
  10. +11 −11 app/models/team.rb
  11. +7 −7 app/models/user.rb
  12. +2 −2 app/views/layouts/application.html.erb
  13. +1 −1  app/views/picks/home.html.erb
  14. +1 −1  app/views/picks/results.html.erb
  15. +1 −1  app/views/players/_players.html.erb
  16. +1 −1  app/views/teams/index.html.erb
  17. +1 −1  config/initializers/inflections.rb
  18. +1 −1  config/initializers/session_store.rb
  19. +2 −2 config/routes.rb
  20. +1 −1  db/migrate/20100505175032_create_users.rb
  21. +1 −1  db/schema.rb
  22. +1 −1  db/seeds.rb
  23. +9 −9 lib/authentication.rb
  24. +18 −18 lib/tasks/import_draft_information.rake
  25. +1 −1  lib/tasks/simulate_draft.rake
  26. +139 −139 log/development.log
  27. +3 −3 public/stylesheets/application.css
  28. +4 −4 spec/controllers/sessions_controller_spec.rb
  29. +4 −4 spec/controllers/users_controller_spec.rb
  30. +14 −14 spec/models/pick_spec.rb
  31. +10 −10 spec/models/player_spec.rb
  32. +4 −4 spec/models/team_spec.rb
  33. +15 −15 spec/models/user_spec.rb
  34. +4 −4 test/fixtures/orders.yml
  35. +2 −2 test/fixtures/players.yml
  36. +2 −2 test/fixtures/teams.yml
  37. +8 −8 test/functional/orders_controller_test.rb
  38. +8 −8 test/functional/picks_controller_test.rb
  39. +8 −8 test/functional/players_controller_test.rb
  40. +8 −8 test/functional/teams_controller_test.rb
  41. +1 −1  test/test_helper.rb
  42. +20 −20 vendor/gems/fastercsv-1.5.3/.specification
  43. +3 −3 vendor/gems/fastercsv-1.5.3/CHANGELOG
  44. +1 −1  vendor/gems/fastercsv-1.5.3/README
  45. +1 −1  vendor/gems/fastercsv-1.5.3/Rakefile
  46. +6 −6 vendor/gems/fastercsv-1.5.3/setup.rb
View
12 README
@@ -1,7 +1,7 @@
== Welcome to Rails
-Rails is a web-application framework that includes everything needed to create
-database-backed web applications according to the Model-View-Control pattern.
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
This pattern splits the view (also called the presentation) into "dumb" templates
that are primarily responsible for inserting pre-built data in between HTML tags.
@@ -57,14 +57,14 @@ Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
-#
+#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
-#
+#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
@@ -85,7 +85,7 @@ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
-#
+#
# Example:
# ErrorDocument 500 /500.html
@@ -132,7 +132,7 @@ and also on programming in general.
Debugger support is available through the debugger command when you start your Mongrel or
Webrick server with --debugger. This means that you can break out of execution at any point
-in the code, investigate and change the model, AND then resume execution!
+in the code, investigate and change the model, AND then resume execution!
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
Example:
View
22 app/controllers/picks_controller.rb
@@ -1,46 +1,46 @@
class PicksController < ApplicationController
-
+
def home
@pick = Pick.current
@end_of_draft = @pick.nil?
@previous_picks = Pick.previous_picks
end
-
+
def index
@picks = Pick.all
end
-
+
def show
@pick = Pick.find(params[:id])
@players = Player.undrafted
end
-
+
def draft_player
-
+
player = Player.find(params[:id])
-
+
unless player.drafted
draft_over = Pick.current.team.draft(player)
-
+
respond_to do |format|
if (!draft_over && player.save)
flash[:notice] = 'Player was successfully drafted.'
format.html { redirect_to(pick_path(Pick.current)) }
else
- flash[:notice] = 'The Draft is over, cannot pick more players,
+ flash[:notice] = 'The Draft is over, cannot pick more players,
or there was an error drafting the player you selected'
format.html { redirect_to(root_path) }
end
end
-
+
else
flash[:notice] = 'That player has already been drafted'
redirect_to(pick_path(Pick.current))
end
end
-
+
def results
@draft_results = Pick.results
end
-
+
end
View
4 app/controllers/players_controller.rb
@@ -2,11 +2,11 @@ class PlayersController < ApplicationController
def index
@players = Player.all
end
-
+
def show
@player = Player.find(params[:id])
end
-
+
def undrafted
unless params[:position.nil?]
@players = Player.filter_position(params[:position])
View
4 app/controllers/sessions_controller.rb
@@ -1,7 +1,7 @@
class SessionsController < ApplicationController
def new
end
-
+
def create
user = User.authenticate(params[:login], params[:password])
if user
@@ -13,7 +13,7 @@ def create
redirect_to_target_or_default(root_url)
end
end
-
+
def destroy
session[:user_id] = nil
flash[:notice] = "You have been logged out."
View
4 app/controllers/teams_controller.rb
@@ -2,9 +2,9 @@ class TeamsController < ApplicationController
def index
@teams = Team.all
end
-
+
def show
@team = Team.find(params[:id])
end
-
+
end
View
2  app/controllers/users_controller.rb
@@ -2,7 +2,7 @@ class UsersController < ApplicationController
def new
@user = User.new
end
-
+
def create
@user = User.new(params[:user])
if @user.save
View
6 app/helpers/layout_helper.rb
@@ -7,15 +7,15 @@ def title(page_title, show_title = true)
@content_for_title = page_title.to_s
@show_title = show_title
end
-
+
def show_title?
@show_title
end
-
+
def stylesheet(*args)
content_for(:head) { stylesheet_link_tag(*args) }
end
-
+
def javascript(*args)
content_for(:head) { javascript_include_tag(*args) }
end
View
22 app/models/pick.rb
@@ -1,21 +1,21 @@
class Pick < ActiveRecord::Base
has_one :player
has_one :team
-
+
validates_presence_of :team_id
-
+
def team
Team.find(self.team_id)
end
-
+
def self.results
Pick.find(:all, :conditions => {:used => true})
end
-
+
def self.current
Pick.first(:conditions => {:used => false})
end
-
+
def self.previous
pick = Pick.current
unless(pick.pick_number == 1)
@@ -23,20 +23,20 @@ def self.previous
else
pick
end
-
+
end
-
+
def self.next
Pick.find_by_pick_number(Pick.current.pick_number+1)
end
-
- def self.previous_picks
+
+ def self.previous_picks
picks = Pick.find(:all, :conditions => {:used => true})
#technically they should already be sorted, but to be robust
picks.sort_by {|pick| pick['pick_number']}
picks.reverse!
picks = picks[0...3]
end
-
-
+
+
end
View
8 app/models/player.rb
@@ -1,16 +1,16 @@
class Player < ActiveRecord::Base
belongs_to :team
belongs_to :pick
-
-
+
+
def self.kipers_best_available
Player.first(:conditions => {:drafted => false})
end
-
+
def self.undrafted
Player.find(:all, :conditions => {:drafted => false})
end
-
+
def self.filter_position(position)
players = Player.find(:all, :conditions => {:position => position, :drafted => false})
players.sort_by{|player| player['name']}
View
22 app/models/team.rb
@@ -1,12 +1,12 @@
class Team < ActiveRecord::Base
belongs_to :pick
has_many :players
-
+
def kiper_draft
- player = Player.kipers_best_available
- do_drafting(player,self)
+ player = Player.kipers_best_available
+ do_drafting(player,self)
end
-
+
def draft(player)
unless Pick.current.pick_number == 255
do_drafting(player,self)
@@ -15,16 +15,16 @@ def draft(player)
draft_over = true
end
end
-
-
-
-
+
+
+
+
protected
-
+
def do_drafting(player, team)
player.drafted = true
player.save
-
+
current_pick = Pick.current
current_pick.player = player
current_pick.player_id = player.id
@@ -33,5 +33,5 @@ def do_drafting(player, team)
team.players.push(player)
end
-
+
end
View
14 app/models/user.rb
@@ -1,10 +1,10 @@
class User < ActiveRecord::Base
# new columns need to be added here to be writable through mass assignment
attr_accessible :username, :email, :password, :password_confirmation
-
+
attr_accessor :password
before_save :prepare_password
-
+
validates_presence_of :username
validates_uniqueness_of :username, :email, :allow_blank => true
validates_format_of :username, :with => /^[-\w\._@]+$/i, :allow_blank => true, :message => "should only contain letters, numbers, or .-_@"
@@ -12,26 +12,26 @@ class User < ActiveRecord::Base
validates_presence_of :password, :on => :create
validates_confirmation_of :password
validates_length_of :password, :minimum => 4, :allow_blank => true
-
+
# login can be either username or email address
def self.authenticate(login, pass)
user = find_by_username(login) || find_by_email(login)
return user if user && user.matching_password?(pass)
end
-
+
def matching_password?(pass)
self.password_hash == encrypt_password(pass)
end
-
+
private
-
+
def prepare_password
unless password.blank?
self.password_salt = Digest::SHA1.hexdigest([Time.now, rand].join)
self.password_hash = encrypt_password(password)
end
end
-
+
def encrypt_password(pass)
Digest::SHA1.hexdigest([pass, password_salt].join)
end
View
4 app/views/layouts/application.html.erb
@@ -19,11 +19,11 @@
<%- flash.each do |name, msg| -%>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
<%- end -%>
-
+
<%- if show_title? -%>
<h1><%=h yield(:title) %></h1>
<%- end -%>
-
+
<%= yield %>
</div>
</body>
View
2  app/views/picks/home.html.erb
@@ -14,7 +14,7 @@
<h2><%= pick.team.name %></h2>
Who drafted <li><%= pick.player.name%>, <%=pick.player.position%></li>
<% end %>
-
+
<h2>The next pick will be</h2>
<li><%= Pick.next.team.name %></li>
View
2  app/views/picks/results.html.erb
@@ -3,5 +3,5 @@
<% @draft_results.each do |result| %>
Round <%= result.round %>
Pick <%= result.pick_number %>
- <li><%= result.player.name %> , <%= result.player.position %></li><br>
+ <li><%= result.player.name %> , <%= result.player.position %></li><br>
<% end %>
View
2  app/views/players/_players.html.erb
@@ -26,5 +26,5 @@
<% unless pick.nil? %>
<%= link_to 'Draft Player', draft_player_path(pick) %></li>
<% end %>
-
+
<% end %>
View
2  app/views/teams/index.html.erb
@@ -4,7 +4,7 @@ Teams
<% @teams.each do |team|%>
<h2><%= team.name %>
<%= team.division %></h2>
-
+
<% team.players.each do |player|%>
<li>
Pick Number <%= player.pick.pick_number %>
View
2  config/initializers/inflections.rb
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
+# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
View
2  config/initializers/session_store.rb
@@ -2,7 +2,7 @@
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
-# Make sure the secret is at least 30 characters and all random,
+# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
:key => '_nfl_draft_session',
View
4 config/routes.rb
@@ -2,11 +2,11 @@
map.signup 'signup', :controller => 'users', :action => 'new'
map.logout 'logout', :controller => 'sessions', :action => 'destroy'
map.login 'login', :controller => 'sessions', :action => 'new'
-
+
map.draft_player '/draft_player/:id', :controller => 'picks', :action => 'draft_player'
map.results '/results/', :controller => 'picks', :action => 'results'
map.undrafted '/undrafted', :controller => 'players', :action => 'undrafted'
map.resources :sessions, :users, :players, :teams, :picks
-
+
map.root :controller => "picks", :action => "home"
end
View
2  db/migrate/20100505175032_create_users.rb
@@ -8,7 +8,7 @@ def self.up
t.timestamps
end
end
-
+
def self.down
drop_table :users
end
View
2  db/schema.rb
@@ -1,4 +1,4 @@
-# This file is auto-generated from the current state of the database. Instead of editing this file,
+# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
View
2  db/seeds.rb
@@ -2,6 +2,6 @@
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
-#
+#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Major.create(:name => 'Daley', :city => cities.first)
View
18 lib/authentication.rb
@@ -1,7 +1,7 @@
# This module is included in your application controller which makes
# several methods available to all controllers and views. Here's a
# common example you might add to your application layout file.
-#
+#
# <% if logged_in? %>
# Welcome <%=h current_user.username %>! Not you?
# <%= link_to "Log out", logout_path %>
@@ -9,25 +9,25 @@
# <%= link_to "Sign up", signup_path %> or
# <%= link_to "log in", login_path %>.
# <% end %>
-#
+#
# You can also restrict unregistered users from accessing a controller using
# a before filter. For example.
-#
+#
# before_filter :login_required, :except => [:index, :show]
module Authentication
def self.included(controller)
controller.send :helper_method, :current_user, :logged_in?, :redirect_to_target_or_default
controller.filter_parameter_logging :password
end
-
+
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
-
+
def logged_in?
current_user
end
-
+
def login_required
unless logged_in?
flash[:error] = "You must first log in or sign up before accessing this page."
@@ -35,14 +35,14 @@ def login_required
redirect_to login_url
end
end
-
+
def redirect_to_target_or_default(default)
redirect_to(session[:return_to] || default)
session[:return_to] = nil
end
-
+
private
-
+
def store_target_location
session[:return_to] = request.request_uri
end
View
36 lib/tasks/import_draft_information.rake
@@ -2,30 +2,30 @@ namespace :db do
desc "Load Players, Draft Order, and teams from csv file"
task :draft_information => :environment do
require 'fastercsv'
-
+
rows_teams = []
rows_players = []
rows_picks = []
-
-
- FasterCSV.foreach("public/csv_files/teams.csv") do |row|
+
+
+ FasterCSV.foreach("public/csv_files/teams.csv") do |row|
unless row[0] == "Team Name"
Team.create(
:name => row[0],
:division => row[1]
)
- rows_teams << row
- end
+ rows_teams << row
+ end
end
-
+
FasterCSV.foreach("public/csv_files/players.csv") do |row|
unless row[0] == "Player Name"
Player.create(
:name => row[0],
:position => row[1]
)
- rows_players << row
- end
+ rows_players << row
+ end
end
FasterCSV.foreach("public/csv_files/order.csv") do |row|
@@ -35,27 +35,27 @@ namespace :db do
:pick_number => row[1],
:team_id => Team.find_by_name("#{row[2]} ").id
)
- rows_picks << row
- end
+ rows_picks << row
+ end
end
-
+
FasterCSV.open("public/csv_files/order.csv", "w") do |csv|
rows_picks.each do |r|
- csv << r
+ csv << r
end
end
-
+
FasterCSV.open("public/csv_files/players.csv", "w") do |csv|
rows_players.each do |r|
- csv << r
+ csv << r
end
end
-
+
FasterCSV.open("public/csv_files/teams.csv", "w") do |csv|
rows_teams.each do |r|
- csv << r
+ csv << r
end
end
-
+
end
end
View
2  lib/tasks/simulate_draft.rake
@@ -5,5 +5,5 @@
picks.each do |pick|
pick.team.kiper_draft
end
-
+
end
View
278 log/development.log
@@ -43,7 +43,7 @@ Migrating to CreateOrders (20100504201821)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 16:43:33) [GET]
ActionController::RoutingError (No route matches "/" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -51,7 +51,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 16:45:37) [GET]
ActionController::RoutingError (No route matches "/" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -59,7 +59,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 16:45:38) [GET]
ActionController::RoutingError (No route matches "/" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -67,7 +67,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 16:45:39) [GET]
ActionController::RoutingError (No route matches "/" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
SQL (0.6ms)  SELECT name
@@ -2422,7 +2422,7 @@ Completed in 5ms (View: 1, DB: 0) | 200 OK [http://localhost/]
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 17:39:58) [GET]
ActionController::RoutingError (No route matches "/2" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -2430,7 +2430,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 17:40:07) [GET]
ActionController::RoutingError (No route matches "/orders/2/show" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -73136,7 +73136,7 @@ Migrating to CreatePicks (20100504201821)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-04 20:38:59) [GET]
NameError (uninitialized constant OrdersController):
-
+
Rendered rescues/_trace (80.7ms)
Rendered rescues/_request_and_response (1.1ms)
@@ -89494,7 +89494,7 @@ Processing ApplicationController#home (for 127.0.0.1 at 2010-05-05 14:14:38) [GE
Parameters: {"action"=>"home", "controller"=>"picks"}
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:2: odd number list for Hash):
-
+
Rendered rescues/_trace (91.0ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -89505,7 +89505,7 @@ Processing ApplicationController#home (for 127.0.0.1 at 2010-05-05 14:14:39) [GE
Parameters: {"action"=>"home", "controller"=>"picks"}
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:2: odd number list for Hash):
-
+
Rendered rescues/_trace (27.8ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -89584,7 +89584,7 @@ Completed in 15ms (View: 10, DB: 1) | 200 OK [http://localhost/]
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-05 14:23:29) [GET]
ActionController::RoutingError (No route matches "/sign_up" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -89674,7 +89674,7 @@ Completed in 11ms (View: 7, DB: 1) | 200 OK [http://localhost/]
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-05 14:25:09) [GET]
ActionController::RoutingError (No route matches "/sign_up" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -90408,7 +90408,7 @@ ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each) on line #7 of app/views/picks/home.html.erb:
4: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-5:
+5:
6: <div class='left_column'>The Previous 3 picks have been
7: <% @precious_pick.each do |pick| %>
8: <%= pick.team %>
@@ -90434,7 +90434,7 @@ ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each) on line #7 of app/views/picks/home.html.erb:
4: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-5:
+5:
6: <div class='left_column'>The Previous 3 picks have been
7: <% @precious_picks.each do |pick| %>
8: <%= pick.team %>
@@ -90460,7 +90460,7 @@ ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each) on line #7 of app/views/picks/home.html.erb:
4: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-5:
+5:
6: <div class='left_column'>The Previous 3 picks have been
7: <% @precious_picks.each do |pick| %>
8: <%= pick.team %>
@@ -90486,7 +90486,7 @@ ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each) on line #7 of app/views/picks/home.html.erb:
4: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-5:
+5:
6: <div class='left_column'>The Previous 3 picks have been
7: <% @precious_picks.each do |pick| %>
8: <%= pick.team %>
@@ -90565,7 +90565,7 @@ ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.size) on line #7 of app/views/picks/home.html.erb:
4: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-5:
+5:
6: <div class='left_column'>The Previous 3 picks have been
7: <%= @previous_picks.size %>
8: <% @previous_picks.each do |pick| %>
@@ -90591,7 +90591,7 @@ ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.size) on line #7 of app/views/picks/home.html.erb:
4: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-5:
+5:
6: <div class='left_column'>The Previous 3 picks have been
7: <%= @previous_picks.size %>
8: <% @previous_picks.each do |pick| %>
@@ -90817,12 +90817,12 @@ ActionView::TemplateError (compile error
/Users/jamestrowbridge/dev/nfl_draft/app/views/picks/home.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting ')'
...at(( link_to "here" draft_path ).to_s); @output_buffer.conca...
^) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here" draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:17:in `compile!'
@@ -90840,12 +90840,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x104321ba8>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -90863,12 +90863,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x1044619a0>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -90886,12 +90886,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x10417c168>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_show_path %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -90909,12 +90909,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x1042a32d0>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_show_path %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -90932,12 +90932,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x104458be8>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_show_path %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -90955,12 +90955,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x104178888>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_show_path %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -90978,12 +90978,12 @@ Rendering template within layouts/application
Rendering picks/home
ActionView::TemplateError (undefined local variable or method `draft_path' for #<ActionView::Base:0x10429ca48>) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", draft_path %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_show_path %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:4
@@ -91101,12 +91101,12 @@ ActionView::TemplateError (compile error
/Users/jamestrowbridge/dev/nfl_draft/app/views/picks/home.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting ')'
...cat(( link_to "here" pick_path(@pick) ).to_s); @output_buffe...
^) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here" pick_path(@pick) %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:17:in `compile!'
@@ -91224,12 +91224,12 @@ ActionView::TemplateError (compile error
/Users/jamestrowbridge/dev/nfl_draft/app/views/picks/home.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting ')'
...cat(( link_to "here" pick_path(@pick) ).to_s); @output_buffe...
^) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here" pick_path(@pick) %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:17:in `compile!'
@@ -91347,12 +91347,12 @@ ActionView::TemplateError (compile error
/Users/jamestrowbridge/dev/nfl_draft/app/views/picks/home.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting ')'
... link_to "here" pick_show_path(@pick) ).to_s); @output_buffe...
^) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here" pick_show_path(@pick) %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:17:in `compile!'
@@ -91470,12 +91470,12 @@ ActionView::TemplateError (compile error
/Users/jamestrowbridge/dev/nfl_draft/app/views/picks/home.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting ')'
... link_to "here" pick_show_path(@pick) ).to_s); @output_buffe...
^) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here" pick_show_path(@pick) %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:17:in `compile!'
@@ -91593,12 +91593,12 @@ ActionView::TemplateError (compile error
/Users/jamestrowbridge/dev/nfl_draft/app/views/picks/home.html.erb:4: syntax error, unexpected tIDENTIFIER, expecting ')'
... link_to "here" pick_show_path(@pick) ).to_s); @output_buffe...
^) on line #4 of app/views/picks/home.html.erb:
-1:
-2:
+1:
+2:
3: <h2>Welcome to the Chase Mock Draft</h2>
4: <h1>If you are an admin and would like to perform the draft click <%= link_to "here" pick_show_path(@pick) %><h1>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: <div class='left_column'>The Previous 3 picks have been
app/views/picks/home.html.erb:17:in `compile!'
@@ -91631,7 +91631,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%=h @pick.round %>
@@ -91652,7 +91652,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round_number' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%=h @pick.round_number %>
@@ -91673,7 +91673,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round_number' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%=h @pick.round_number %>
@@ -91694,7 +91694,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round_number' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%=h @pick.round_number %>
@@ -91715,7 +91715,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91736,7 +91736,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91757,7 +91757,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91778,7 +91778,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91800,7 +91800,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91821,7 +91821,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91853,7 +91853,7 @@ Processing ApplicationController#show (for 127.0.0.1 at 2010-05-05 18:04:09) [GE
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:2: syntax error, unexpected ':', expecting kEND
before_filter :grab_pick :only => {:show, :edit, :update, :destroy}
^):
-
+
Rendered rescues/_trace (86.4ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -91866,7 +91866,7 @@ Processing ApplicationController#show (for 127.0.0.1 at 2010-05-05 18:04:10) [GE
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:2: syntax error, unexpected ':', expecting kEND
before_filter :grab_pick :only => {:show, :edit, :update, :destroy}
^):
-
+
Rendered rescues/_trace (26.7ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -91879,7 +91879,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91900,7 +91900,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91921,7 +91921,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -91942,7 +91942,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -92027,7 +92027,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -92048,7 +92048,7 @@ Rendering template within layouts/application
Rendering picks/show
ActionView::TemplateError (undefined method `round' for nil:NilClass) on line #5 of app/views/picks/show.html.erb:
-2:
+2:
3: <p>
4: <strong>Round:</strong>
5: <%= @pick.round %>
@@ -93432,9 +93432,9 @@ ActionView::TemplateError (compile error
^) on line #16 of app/views/picks/show.html.erb:
13: <%= @pick.team.name %>
14: </p>
-15:
+15:
16: <%= render :partial => '/players/players' :locals =>{:players => players} %>
-17:
+17:
18: <p>
19: <%= link_to "Edit", edit_pick_path(@pick) %> |
@@ -93455,9 +93455,9 @@ Rendering picks/show
ActionView::TemplateError (undefined local variable or method `players' for #<ActionView::Base:0x1040619e0>) on line #16 of app/views/picks/show.html.erb:
13: <%= @pick.team.name %>
14: </p>
-15:
+15:
16: <%= render :partial => '/players/players', :locals =>{:players => players} %>
-17:
+17:
18: <p>
19: <%= link_to "Edit", edit_pick_path(@pick) %> |
@@ -93478,9 +93478,9 @@ Rendering picks/show
ActionView::TemplateError (undefined local variable or method `players' for #<ActionView::Base:0x104120fe8>) on line #16 of app/views/picks/show.html.erb:
13: <%= @pick.team.name %>
14: </p>
-15:
+15:
16: <%= render :partial => '/players/players', :locals =>{:players => players} %>
-17:
+17:
18: <p>
19: <%= link_to "Edit", edit_pick_path(@pick) %> |
@@ -93501,9 +93501,9 @@ Rendering picks/show
ActionView::TemplateError (undefined local variable or method `players' for #<ActionView::Base:0x10420c5b0>) on line #16 of app/views/picks/show.html.erb:
13: <%= @pick.team.name %>
14: </p>
-15:
+15:
16: <%= render :partial => '/players/players', :locals =>{:players => players} %>
-17:
+17:
18: <p>
19: <%= link_to "Edit", edit_pick_path(@pick) %> |
@@ -93783,7 +93783,7 @@ ActionView::TemplateError (compile error
2: <%= player.name %>
3: <%= player.position %>
4: <%= link_to 'Draft Player', draft_player_path(player), %>
-5:
+5:
6: <%= end %>
app/views/players/_players.html.erb:9:in `compile!'
@@ -93914,7 +93914,7 @@ ActionView::TemplateError (compile error
2: <%= player.name %>
3: <%= player.position %>
4: <%= link_to 'Draft Player', draft_player_path(player), %>
-5:
+5:
6: <% end %>
app/views/players/_players.html.erb:9:in `compile!'
@@ -94045,7 +94045,7 @@ ActionView::TemplateError (compile error
2: <%= player.name %>
3: <%= player.position %>
4: <%= link_to 'Draft Player', draft_player_path(player.id), %>
-5:
+5:
6: <% end %>
app/views/players/_players.html.erb:9:in `compile!'
@@ -94180,7 +94180,7 @@ ActionView::TemplateError (compile error
2: <%= player.name %>
3: <%= player.position %>
4: <%= link_to 'Draft Player', draft_player_path(player), %>
-5:
+5:
6: <% end %>
app/views/players/_players.html.erb:9:in `compile!'
@@ -94311,7 +94311,7 @@ ActionView::TemplateError (compile error
2: <%= player.name %>
3: <%= player.position %>
4: <%= link_to 'Draft Player', draft_player_path, %>
-5:
+5:
6: <% end %>
app/views/players/_players.html.erb:9:in `compile!'
@@ -94359,7 +94359,7 @@ Processing PicksController#draft_player (for 127.0.0.1 at 2010-05-05 18:28:25) [
Player Update (0.2ms) UPDATE "players" SET "updated_at" = '2010-05-05 22:28:25', "team_id" = 32 WHERE "id" = 1
ActionView::MissingTemplate (Missing template picks/draft_player.erb in view path app/views):
-
+
Rendering rescues/layout (internal_server_error)
@@ -98222,7 +98222,7 @@ Processing PicksController#index to #<pick:0x10445d530> (for 127.0.0.1 at 2010-0
Pick Load (16.7ms) SELECT * FROM "picks" 
ActionView::MissingTemplate (Missing template picks/index.erb in view path app/views):
-
+
Rendering rescues/layout (internal_server_error)
@@ -103342,7 +103342,7 @@ ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :c
3: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", pick_path(@pick) %><h1>
4: <% end %>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
(eval):16:in `pick_path'
app/views/picks/home.html.erb:3
@@ -105057,10 +105057,10 @@ Processing TeamsController#index (for 127.0.0.1 at 2010-05-05 19:49:50) [GET]
Parameters: {"action"=>"index", "controller"=>"teams"}
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/models/team.rb:9: syntax error, unexpected '=', expecting kEND
- proceed? = do_drafting?(player)
+ proceed? = do_drafting?(player)
^
/Users/jamestrowbridge/dev/nfl_draft/app/models/team.rb:16: syntax error, unexpected '=', expecting kEND
- proceed? = do_drafting?(player)
+ proceed? = do_drafting?(player)
^):
app/controllers/teams_controller.rb:3:in `index'
@@ -105617,7 +105617,7 @@ Processing ApplicationController#home (for 127.0.0.1 at 2010-05-05 20:05:21) [GE
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:58: syntax error, unexpected '=', expecting kEND
draft_over? = Pick.current.team.draft(Player.find(params[:id]))
^):
-
+
Rendered rescues/_trace (92.2ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -105630,7 +105630,7 @@ Processing ApplicationController#home (for 127.0.0.1 at 2010-05-05 20:05:38) [GE
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:58: syntax error, unexpected '=', expecting kEND
draft_over? = Pick.current.team.draft(Player.find(params[:id]))
^):
-
+
Rendered rescues/_trace (28.5ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -105643,7 +105643,7 @@ Processing ApplicationController#home (for 127.0.0.1 at 2010-05-05 20:05:38) [GE
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:58: syntax error, unexpected '=', expecting kEND
draft_over? = Pick.current.team.draft(Player.find(params[:id]))
^):
-
+
Rendered rescues/_trace (91.5ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -105668,7 +105668,7 @@ ActionView::TemplateError (/Users/jamestrowbridge/dev/nfl_draft/app/models/team.
3: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", pick_path(@pick) %><h1>
4: <% end %>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: The Previous 3 picks have been
8: <% @previous_picks.each do |pick| %>
@@ -106996,7 +106996,7 @@ Rendering picks/home
ActionView::TemplateError (No route matches {:action=>"results", :controller=>"picks"}) on line #17 of app/views/picks/home.html.erb:
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", teams_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", :controller => 'picks', :action => "results" %>
@@ -107028,7 +107028,7 @@ Rendering picks/home
ActionView::TemplateError (undefined local variable or method `pick_results_path' for #<ActionView::Base:0x1043e7f38>) on line #16 of app/views/picks/home.html.erb:
13: <h2>The next pick will be</h2>
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", pick_results_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", :controller => 'picks', :action => "results" %>
@@ -107060,7 +107060,7 @@ Rendering picks/home
ActionView::TemplateError (undefined local variable or method `results_pick_path' for #<ActionView::Base:0x104416608>) on line #16 of app/views/picks/home.html.erb:
13: <h2>The next pick will be</h2>
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", results_pick_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", :controller => 'picks', :action => "results" %>
@@ -107092,7 +107092,7 @@ Rendering picks/home
ActionView::TemplateError (undefined local variable or method `results_pick_path' for #<ActionView::Base:0x1044b7d50>) on line #16 of app/views/picks/home.html.erb:
13: <h2>The next pick will be</h2>
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", results_pick_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", :controller => 'picks', :action => "results" %>
@@ -107124,7 +107124,7 @@ Rendering picks/home
ActionView::TemplateError (undefined local variable or method `results_pick_path' for #<ActionView::Base:0x1043898c0>) on line #16 of app/views/picks/home.html.erb:
13: <h2>The next pick will be</h2>
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", results_pick_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", :controller => 'picks', :action => "results" %>
@@ -107156,7 +107156,7 @@ Rendering picks/home
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #16 of app/views/picks/home.html.erb:
13: <h2>The next pick will be</h2>
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", pick_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", results_path %>
@@ -107189,7 +107189,7 @@ Rendering picks/home
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #16 of app/views/picks/home.html.erb:
13: <h2>The next pick will be</h2>
14: <li><%= Pick.next.team.name %></li>
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", pick_path %><h1>
17: <h1>To view the current draft results in full click <%= link_to "here", results_path %>
@@ -107833,7 +107833,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #4
1: <% @draft_results.each do |result| %>
2: Round <%= result.round %>
3: Pick <%= result.pick_number %>
-4: <li>Player <%= result.player.name %><li>
+4: <li>Player <%= result.player.name %><li>
5: <% end %>
app/views/picks/results.html.erb:4
@@ -110947,7 +110947,7 @@ Rendering picks/home
CACHE (0.0ms) SELECT * FROM "teams" WHERE ("teams"."id" = 30) 
ActionView::TemplateError (undefined local variable or method `undrafted' for #<ActionView::Base:0x104469178>) on line #18 of app/views/picks/home.html.erb:
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
17: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
18: <h1>To view the the remaining players <%= link_to "here", undrafted %></h1>
@@ -110978,7 +110978,7 @@ Rendering picks/home
CACHE (0.0ms) SELECT * FROM "teams" WHERE ("teams"."id" = 30) 
ActionView::TemplateError (undefined local variable or method `undrafted_path' for #<ActionView::Base:0x103f527e8>) on line #18 of app/views/picks/home.html.erb:
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
17: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
18: <h1>To view the the remaining players <%= link_to "here", undrafted_path %></h1>
@@ -111009,7 +111009,7 @@ Rendering picks/home
CACHE (0.0ms) SELECT * FROM "teams" WHERE ("teams"."id" = 30) 
ActionView::TemplateError (undefined local variable or method `undrafted_path' for #<ActionView::Base:0x104080c50>) on line #18 of app/views/picks/home.html.erb:
-15:
+15:
16: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
17: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
18: <h1>To view the the remaining players <%= link_to "here", undrafted_path %></h1>
@@ -111024,7 +111024,7 @@ Rendering rescues/layout (internal_server_error)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-05 21:03:15) [GET]
ActionController::RoutingError (No route matches "/undrafted_path" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -111044,7 +111044,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-05 21:03:33) [GET]
ActionController::RoutingError (No route matches "/players/1/undrafted" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -116609,7 +116609,7 @@ ActionView::TemplateError (undefined method `team' for nil:NilClass) on line #5
3: <h1>If you are an admin and would like to perform the draft click <%= link_to "here", pick_path(@pick) %><h1>
4: <% end %>
5: <h2>The <%= @pick.team.name %> are on the Clock! with pick number <%= @pick.pick_number %> in the draft<h2>
-6:
+6:
7: The Previous 3 picks have been
8: <% @previous_picks.each do |pick| %>
@@ -116638,10 +116638,10 @@ Rendering picks/home
ActionView::TemplateError (undefined method `pick_number' for nil:NilClass) on line #19 of app/views/picks/home.html.erb:
16: <% end %>
-17:
+17:
18: <h2>The next pick will be</h2>
19: <li><%= Pick.next.team.name %></li>
-20:
+20:
21: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
22: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
@@ -118931,7 +118931,7 @@ Completed in 66ms (View: 36, DB: 25) | 200 OK [http://localhost/teams]
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-06 11:38:47) [GET]
ActionController::RoutingError (No route matches "/pick/1" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -118939,7 +118939,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-06 11:38:51) [GET]
ActionController::RoutingError (No route matches "/pick/1/show" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -118947,7 +118947,7 @@ Rendering rescues/layout (not_found)
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-06 11:38:56) [GET]
ActionController::RoutingError (No route matches "/picks/1/show" with {:method=>:get}):
-
+
Rendering rescues/layout (not_found)
@@ -119544,7 +119544,7 @@ Rendering picks/show
ActionView::TemplateError (Missing template picks/_players.erb in view path app/views) on line #16 of app/views/picks/show.html.erb:
13: <%= @pick.team.name %>
14: </p>
-15:
+15:
16: <%= render :partial => 'players', :locals => {:players => @players}%>
17: <p>
18: <%= link_to "Edit", edit_pick_path(@pick) %> |
@@ -130949,7 +130949,7 @@ ActionView::TemplateError (undefined method `current' for #<Pick:0x104388b00>) o
26: <% unless pick.current.pick_number == 255 %>
27: <%= link_to 'Draft Player', pick_path(pick) %></li>
28: <% end %>
-29:
+29:
app/views/players/_players.html.erb:26
app/views/players/_players.html.erb:23:in `each'
@@ -131076,7 +131076,7 @@ Rendering picks/home
Team Load (0.2ms) SELECT * FROM "teams" WHERE ("teams"."id" = 4) 
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #26 of app/views/picks/home.html.erb:
-23:
+23:
24: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
25: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
26: <h1>To view the the remaining players <%= link_to "here", pick_path %></h1>
@@ -131108,7 +131108,7 @@ Rendering picks/home
Team Load (0.2ms) SELECT * FROM "teams" WHERE ("teams"."id" = 4) 
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #26 of app/views/picks/home.html.erb:
-23:
+23:
24: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
25: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
26: <h1>To view the the remaining players <%= link_to "here", pick_path %></h1>
@@ -131140,7 +131140,7 @@ Rendering picks/home
Team Load (0.2ms) SELECT * FROM "teams" WHERE ("teams"."id" = 4) 
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #26 of app/views/picks/home.html.erb:
-23:
+23:
24: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
25: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
26: <h1>To view the the remaining players <%= link_to "here", pick_path %></h1>
@@ -131172,7 +131172,7 @@ Rendering picks/home
Team Load (0.2ms) SELECT * FROM "teams" WHERE ("teams"."id" = 4) 
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #26 of app/views/picks/home.html.erb:
-23:
+23:
24: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
25: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
26: <h1>To view the the remaining players <%= link_to "here", pick_path %></h1>
@@ -131204,7 +131204,7 @@ Rendering picks/home
Team Load (0.2ms) SELECT * FROM "teams" WHERE ("teams"."id" = 4) 
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #26 of app/views/picks/home.html.erb:
-23:
+23:
24: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
25: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
26: <h1>To view the the remaining players <%= link_to "here", pick_path %></h1>
@@ -131236,7 +131236,7 @@ Rendering picks/home
Team Load (0.2ms) SELECT * FROM "teams" WHERE ("teams"."id" = 4) 
ActionView::TemplateError (pick_url failed to generate from {:action=>"show", :controller=>"picks"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["picks", :id] - are they all satisfied?) on line #26 of app/views/picks/home.html.erb:
-23:
+23:
24: <h1>To view what players your team drafted click <%= link_to "here", teams_path %></h1>
25: <h1>To view the current draft results in full click <%= link_to "here", results_path %></h1>
26: <h1>To view the the remaining players <%= link_to "here", pick_path %></h1>
@@ -131591,7 +131591,7 @@ Rendering players/undrafted
Pick Load (0.3ms) SELECT * FROM "picks" WHERE ("picks"."used" = 'f') LIMIT 1
ActionView::TemplateError (pick_url failed to generate from {:position=>"QB", :action=>"show", :controller=>"picks"}, expected: {:action=>"show", :controller=>"picks"}, diff: {:position=>"QB"}) on line #3 of app/views/players/_players.html.erb:
-1:
+1:
2: <h1>Players still undrafted</h1>
3: <%= link_to "QB", pick_path(:position => "QB")%> |
4: <%= link_to "WR", pick_path(:position => "WR")%> |
@@ -131615,7 +131615,7 @@ Rendering players/undrafted
Pick Load (0.3ms) SELECT * FROM "picks" WHERE ("picks"."used" = 'f') LIMIT 1
ActionView::TemplateError (pick_url failed to generate from {:position=>"QB", :action=>"show", :controller=>"picks"}, expected: {:action=>"show", :controller=>"picks"}, diff: {:position=>"QB"}) on line #3 of app/views/players/_players.html.erb:
-1:
+1:
2: <h1>Players still undrafted</h1>
3: <%= link_to "QB", pick_path(:position => "QB")%> |
4: <%= link_to "WR", pick_path(:position => "WR")%> |
@@ -131742,7 +131742,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #4
1: <% @draft_results.each do |result| %>
2: Round <%= result.round %>
3: Pick <%= result.pick_number %>
-4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
+4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
5: <% end %>
app/views/picks/results.html.erb:4
@@ -131965,7 +131965,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #4
1: <% @draft_results.each do |result| %>
2: Round <%= result.round %>
3: Pick <%= result.pick_number %>
-4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
+4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
5: <% end %>
app/views/picks/results.html.erb:4
@@ -132270,7 +132270,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #14
13: <h2><%= pick.team.name %></h2>
14: Who drafted <li><%= pick.player.name%>, <%=pick.player.position%></li>
15: <% end %>
-16:
+16:
17: <h2>The next pick will be</h2>
app/views/picks/home.html.erb:14
@@ -134452,7 +134452,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #4
1: <% @draft_results.each do |result| %>
2: Round <%= result.round %>
3: Pick <%= result.pick_number %>
-4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
+4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
5: <% end %>
app/views/picks/results.html.erb:4
@@ -134481,7 +134481,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #4
1: <% @draft_results.each do |result| %>
2: Round <%= result.round %>
3: Pick <%= result.pick_number %>
-4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
+4: <li><%= result.player.name %> , <%= result.player.position %></li><br>
5: <% end %>
app/views/picks/results.html.erb:4
@@ -148760,7 +148760,7 @@ ActionView::TemplateError (undefined method `pick_number' for nil:NilClass) on l
26: <% unless pick.pick_number == 255 %>
27: <%= link_to 'Draft Player', draft_player_path(pick) %></li>
28: <% end %>
-29:
+29:
app/views/players/_players.html.erb:26
app/views/players/_players.html.erb:23:in `each'
@@ -148786,7 +148786,7 @@ ActionView::TemplateError (undefined method `pick_number' for nil:NilClass) on l
26: <% unless pick.pick_number.nil? %>
27: <%= link_to 'Draft Player', draft_player_path(pick) %></li>
28: <% end %>
-29:
+29:
app/views/players/_players.html.erb:26
app/views/players/_players.html.erb:23:in `each'
@@ -148812,7 +148812,7 @@ ActionView::TemplateError (undefined method `pick_number' for nil:NilClass) on l
26: <% unless pick.pick_number.nil? %>
27: <%= link_to 'Draft Player', draft_player_path(pick) %></li>
28: <% end %>
-29:
+29:
app/views/players/_players.html.erb:26
app/views/players/_players.html.erb:23:in `each'
@@ -149011,7 +149011,7 @@ Processing SessionsController#new (for 127.0.0.1 at 2010-05-06 13:37:31) [GET]
Parameters: {"action"=>"new", "controller"=>"sessions"}
ActionView::MissingTemplate (Missing template sessions/new.erb in view path app/views):
-
+
Rendering rescues/layout (internal_server_error)
@@ -151745,7 +151745,7 @@ ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #15
14: <h2><%= pick.team.name %></h2>
15: Who drafted <li><%= pick.player.name%>, <%=pick.player.position%></li>
16: <% end %>
-17:
+17:
18: <h2>The next pick will be</h2>
app/views/picks/home.html.erb:15
@@ -152827,7 +152827,7 @@ Processing PicksController#draft_player (for 127.0.0.1 at 2010-05-06 14:00:09) [
Player Load (0.2ms) SELECT * FROM "players" WHERE ("players"."id" = 1) 
ActionView::MissingTemplate (Missing template picks/draft_player.erb in view path app/views):
-
+
Rendering rescues/layout (internal_server_error)
@@ -152836,7 +152836,7 @@ Processing ApplicationController#draft_player (for 127.0.0.1 at 2010-05-06 14:01
Parameters: {"action"=>"draft_player", "id"=>"1", "controller"=>"picks"}
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:43: syntax error, unexpected $end, expecting kEND):
-
+
Rendered rescues/_trace (28.0ms)
Rendered rescues/_request_and_response (0.3ms)
@@ -152847,7 +152847,7 @@ Processing ApplicationController#draft_player (for 127.0.0.1 at 2010-05-06 14:01
Parameters: {"action"=>"draft_player", "id"=>"1", "controller"=>"picks"}
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:43: syntax error, unexpected $end, expecting kEND):
-
+
Rendered rescues/_trace (28.4ms)
Rendered rescues/_request_and_response (0.4ms)
@@ -152858,7 +152858,7 @@ Processing ApplicationController#home (for 127.0.0.1 at 2010-05-06 14:01:13) [GE
Parameters: {"action"=>"home", "controller"=>"picks"}
SyntaxError (/Users/jamestrowbridge/dev/nfl_draft/app/controllers/picks_controller.rb:43: syntax error, unexpected $end, expecting kEND):
-
+
Rendered rescues/_trace (27.7ms)
Rendered rescues/_request_and_response (0.3ms)
View
6 public/stylesheets/application.css
@@ -8,21 +8,21 @@ h1{
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: 0;
- color: #000;
+ color: #000;
}
h2{
padding: 30px 5px 10px 15px;
font-size: 24px;
margin: 0;
- color: #000;
+ color: #000;
}
h3{
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: 0;
- color: #FFF;
+ color: #FFF;
}
a img {
View
8 spec/controllers/sessions_controller_spec.rb
@@ -1,21 +1,21 @@
require File.dirname(__FILE__) + '/../spec_helper'
-
+
describe SessionsController do
fixtures :all
integrate_views
-
+
it "new action should render new template" do
get :new
response.should render_template(:new)
end
-
+
it "create action should render new template when authentication is invalid" do
User.stubs(:authenticate).returns(nil)
post :create
response.should render_template(:new)
session['user_id'].should be_nil
end
-
+
it "create action should redirect when authentication is valid" do
User.stubs(:authenticate).returns(User.first)
post :create
View
8 spec/controllers/users_controller_spec.rb
@@ -1,20 +1,20 @@
require File.dirname(__FILE__) + '/../spec_helper'
-
+
describe UsersController do
fixtures :all
integrate_views
-
+
it "new action should render new template" do
get :new
response.should render_template(:new)
end
-
+
it "create action should render new template when model is invalid" do
User.any_instance.stubs(:valid?).returns(false)
post :create
response.should render_template(:new)
end
-
+
it "create action should redirect when model is valid" do
User.any_instance.stubs(:valid?).returns(true)
post :create
View
28 spec/models/pick_spec.rb
@@ -7,16 +7,16 @@
:pick_number => 2,
:team_id => 1
)
-
+
@team = Team.create(
:name => "Washington Redskins",
:division => "NFC East",
:pick_id => 1
)
end
-
+
describe " a new pick that is created" do
-
+
it "should have a team number associated to the pick" do
@pick.team_id == 1
end
@@ -24,19 +24,19 @@
it "should have be able to find a team object that owns the pick" do
@pick.team == @team
end
-
+
it "should not have a player assigned to it yet" do
@pick.player == nil
end
-
+
end
-
+
describe "when the draft is currently going on" do
-
+
it "should be able to keep track of the team who has the current pick" do
Pick.current.pick_number == @pick.pick_number
end
-
+
it "should be able to keep track of the team who has the next pick" do
Pick.create(
:round => 1,
@@ -45,7 +45,7 @@
)
Pick.current.pick_number < Pick.next.pick_number
end
-
+
it "should be able to keep track of the previous picks" do
pick_two = Pick.create(
:round => 1,
@@ -55,7 +55,7 @@
)
Pick.current.pick_number > Pick.previous.pick_number
end
-
+
it "should be able to find the last three picks" do
pick_one = Pick.create(
:round => 1,
@@ -78,13 +78,13 @@
:team_id => 1,
:used => false
)
- Pick.current == pick_four
+ Pick.current == pick_four
Pick.previous_picks.size <= 3
Pick.previous_picks.include?(pick_one)
Pick.previous_picks.include?(pick_two)
Pick.previous_picks.include?(pick_three)
end
-
+
it "should give the appropriate amount of picks if there are less than three" do
pick_one = Pick.create(
:round => 1,
@@ -95,8 +95,8 @@
Pick.current == @pick
Pick.previous_picks.include?(pick_one)
end
-
+
end
-
+
end
View
20 spec/models/player_spec.rb
@@ -7,13 +7,13 @@
:pick_number => 2,
:team_id => 1
)
-
+
@team = Team.create(
:name => "Washington Redskins",
:division => "NFC East",
:pick_id => 1
)
-
+
@player = Player.create(
:name => "Colt McCoy",
:position => "QB"
@@ -21,20 +21,20 @@
end
describe "when he is drafted" do
-
+
it "should mark him as a drafted player" do
@team.draft(@player)
@player.drafted == true
end
-
+
it "should update the pick with him as the player" do
@team.draft(@player)
@pick.player == @player
end
end
-
+
describe "when a player list is asked to be sorted" do
-
+
it "should only contain players of that position" do
players = []
players.push(Player.create(
@@ -46,12 +46,12 @@
:position => "CB"
))
players.push(@player)
-
+
player = Player.filter_position("CB")
-
- player.first.position == "CB"
+
+ player.first.position == "CB"
end
-
+
it "should be listed in alphabetical order " do
players = []
players.push(Player.create(
View
8 spec/models/team_spec.rb
@@ -7,13 +7,13 @@
:pick_number => 2,
:team_id => 1
)
-
+
@team = Team.create(
:name => "Washington Redskins",
:division => "NFC East",
:pick_id => 1
)
-
+
@player = Player.create(
:name => "Colt McCoy",
:position => "QB"
@@ -25,13 +25,13 @@
@team.draft(@player)
@team.players.include?(@player) == true
end
-
+
it "should use kiper best available if no player is given" do
player = Player.kipers_best_available
@team.kiper_draft
@team.players.include?(player)
end
-
+
it "should not allow any more players to be drafted after the last pick" do
254.times do |i|
Pick.create(
View
30 spec/models/user_spec.rb
@@ -8,72 +8,72 @@ def new_user(attributes = {})
attributes[:password_confirmation] ||= attributes[:password]
User.new(attributes)
end
-
+
before(:each) do
User.delete_all
end
-
+
it "should be valid" do
new_user.should be_valid
end
-
+
it "should require username" do
new_user(:username => '').should have(1).error_on(:username)
end
-
+
it "should require password" do
new_user(:password => '').should have(1).error_on(:password)
end
-
+
it "should require well formed email" do
new_user(:email => 'foo@bar@example.com').should have(1).error_on(:email)
end
-
+
it "should validate uniqueness of email" do
new_user(:email => 'bar@example.com').save!
new_user(:email => 'bar@example.com').should have(1).error_on(:email)
end
-
+
it "should validate uniqueness of username" do
new_user(:username => 'uniquename').save!
new_user(:username => 'uniquename').should have(1).error_on(:username)
end
-
+
it "should not allow odd characters in username" do
new_user(:username => 'odd ^&(@)').should have(1).error_on(:username)
end
-
+
it "should validate password is longer than 3 characters" do
new_user(:password => 'bad').should have(1).error_on(:password)
end
-
+
it "should require matching password confirmation" do
new_user(:password_confirmation => 'nonmatching').should have(1).error_on(:password)
end
-
+
it "should generate password hash and salt on create" do
user = new_user
user.save!
user.password_hash.should_not be_nil
user.password_salt.should_not be_nil
end
-
+