Permalink
Browse files

first tests on Team

  • Loading branch information...
1 parent 272cced commit 476a3776a4d2ea00ca99b0d2e50c873bbbb0bc82 @jeanmartin jeanmartin committed May 25, 2012
View
@@ -24,6 +24,7 @@ gem "launchy", ">= 2.1.0", :group => :test
gem "rspec-rails", ">= 2.10.1", :group => [:development, :test]
gem "factory_girl_rails", ">= 3.3.0", :group => [:development, :test]
gem "email_spec", ">= 1.2.1", :group => :test
+gem 'shoulda', :group => :test
gem "guard", ">= 0.6.2", :group => :development
case HOST_OS
when /darwin/i
View
@@ -197,6 +197,11 @@ GEM
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
+ shoulda (3.0.1)
+ shoulda-context (~> 1.0.0)
+ shoulda-matchers (~> 1.0.0)
+ shoulda-context (1.0.0)
+ shoulda-matchers (1.0.0)
simple_form (2.0.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
@@ -248,5 +253,6 @@ DEPENDENCIES
rb-fsevent
rspec-rails (>= 2.10.1)
sass-rails (~> 3.2.3)
+ shoulda
simple_form
uglifier (>= 1.0.3)
@@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base
-include Facebooker2::Rails::Controller
- helper :all
- protect_from_forgery
+ include Facebooker2::Rails::Controller
+ helper :all
+ protect_from_forgery
end
View
@@ -1,3 +1,16 @@
class Team < ActiveRecord::Base
- attr_accessible :country, :draw, :group_cd, :last_16, :last_2, :last_4, :last_8, :lost, :place, :won
+ attr_accessible :country, :draw, :group, :last_16, :last_2, :last_4, :last_8, :lost, :place, :won
+
+ # relations
+
+ # validations
+ validates :country, :group, :presence => true
+
+ # plugins
+ as_enum :group, { :a => 0, :b => 1, :c => 2, :d => 3, :e => 4 }
+
+
+
+
+
end
View
@@ -25,8 +25,11 @@ class Application < Rails::Application
end
- config.sass.load_paths << "/Users/maximilianwoltersdorf/.rvm/gems/ruby-1.9.3-p194@em/gems/compass-0.12.1/frameworks/compass/stylesheets"
- config.sass.load_paths << "/Users/maximilianwoltersdorf/.rvm/gems/ruby-1.9.3-p194@em/gems/compass-960-plugin-0.10.4/stylesheets"
+ config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
+ config.sass.load_paths << "#{Gem.loaded_specs['compass-960-plugin'].full_gem_path}/stylesheets"
+ #config.sass.load_paths << "/Users/maximilianwoltersdorf/.rvm/gems/ruby-1.9.3-p194@em/gems/compass-0.12.1/frameworks/compass/stylesheets"
+ #config.sass.load_paths << "/Users/maximilianwoltersdorf/.rvm/gems/ruby-1.9.3-p194@em/gems/compass-960-plugin-0.10.4/stylesheets"
+
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
View
@@ -1,6 +1,11 @@
production:
app_id: 284301908333107
secret: dab5d67a22dc942bb3ef86ab8060124a
+
development:
app_id: 284301908333107
secret: dab5d67a22dc942bb3ef86ab8060124a
+
+test:
+ app_id: 284301908333107
+ secret: dab5d67a22dc942bb3ef86ab8060124a
@@ -1 +1 @@
-require 'ninesixty'
+require 'ninesixty'
@@ -0,0 +1 @@
+require 'simple_enum'
@@ -2,17 +2,15 @@ class CreateTeams < ActiveRecord::Migration
def change
create_table :teams do |t|
t.string :country
- t.integer :won
- t.integer :lost
- t.integer :draw
+ t.integer :won, :lost, :draw, :default => 0
t.integer :group_cd
- t.boolean :last_16
- t.boolean :last_8
- t.boolean :last_4
- t.boolean :last_2
+ t.boolean :last_16, :last_8, :last_4, :last_2, :default => nil
t.integer :place
t.timestamps
end
+ add_index :teams, :country
+ add_index :teams, :group_cd
+ add_index :teams, :place
end
end
View
@@ -0,0 +1,35 @@
+# encoding: UTF-8
+# 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.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20120525145815) do
+
+ create_table "teams", :force => true do |t|
+ t.string "country"
+ t.integer "won", :default => 0
+ t.integer "lost", :default => 0
+ t.integer "draw", :default => 0
+ t.integer "group_cd"
+ t.boolean "last_16"
+ t.boolean "last_8"
+ t.boolean "last_4"
+ t.boolean "last_2"
+ t.integer "place"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "teams", ["country"], :name => "index_teams_on_country"
+ add_index "teams", ["group_cd"], :name => "index_teams_on_group_cd"
+ add_index "teams", ["place"], :name => "index_teams_on_place"
+
+end
Oops, something went wrong.

0 comments on commit 476a377

Please sign in to comment.