Commit 4bb7ebf71192bbc396c2b8fd68da1042efb62ff2
- Date: Sun Mar 02 18:29:18 +0000 2008
- Committer: David A. Cuadrado (krawek@gmail.com)
- Author: David A. Cuadrado (krawek@gmail.com)
- Commit SHA1: 4bb7ebf71192bbc396c2b8fd68da1042efb62ff2
- Tree SHA1: 37a2c4cfed02b722e5e9c034a3cae061ed983a85
Finished postgres support
Commit diff
| |   |
| 3 | 3 | create_table :comments do |t| |
| 4 | 4 | t.integer :user_id, :null => false |
| 5 | 5 | t.integer :repository_id, :null => false |
| 6 | | t.string :sha1, :null => false |
| 6 | t.string :sha1, :null => true |
| 7 | 7 | t.text :body |
| 8 | 8 | t.timestamps |
| 9 | 9 | end |
| toggle raw diff |
--- a/db/migrate/019_create_comments.rb
+++ b/db/migrate/019_create_comments.rb
@@ -3,7 +3,7 @@ class CreateComments < ActiveRecord::Migration
create_table :comments do |t|
t.integer :user_id, :null => false
t.integer :repository_id, :null => false
- t.string :sha1, :null => false
+ t.string :sha1, :null => true
t.text :body
t.timestamps
end |
| |   |
| 14 | 14 | create_table "comments", :force => true do |t| |
| 15 | 15 | t.integer "user_id", :null => false |
| 16 | 16 | t.integer "repository_id", :null => false |
| 17 | | t.string "sha1", :null => false |
| 17 | t.string "sha1" |
| 18 | 18 | t.text "body" |
| 19 | 19 | t.datetime "created_at" |
| 20 | 20 | t.datetime "updated_at" |
| toggle raw diff |
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -14,7 +14,7 @@ ActiveRecord::Schema.define(:version => 20) do
create_table "comments", :force => true do |t|
t.integer "user_id", :null => false
t.integer "repository_id", :null => false
- t.string "sha1", :null => false
+ t.string "sha1"
t.text "body"
t.datetime "created_at"
t.datetime "updated_at" |
| |   |
| 37 | 37 | |
| 38 | 38 | it "gets a list of recent comments from users projects" do |
| 39 | 39 | get :dashboard |
| 40 | | assigns[:recent_comments].should == comments(:johans_repos, :johans_repos2) |
| 40 | |
| 41 | comment_list = comments(:johans_repos, :johans_repos2) |
| 42 | |
| 43 | puts comment_list.inspect |
| 44 | |
| 45 | comment_list.each { |comment| |
| 46 | assigns[:recent_comments].include?(comment).should == true |
| 47 | } |
| 41 | 48 | end |
| 42 | 49 | |
| 43 | 50 | it "gets a list of all the clones made of current_users repositories" do |
| toggle raw diff |
--- a/spec/controllers/site_controller_spec.rb
+++ b/spec/controllers/site_controller_spec.rb
@@ -37,7 +37,14 @@ describe SiteController do
it "gets a list of recent comments from users projects" do
get :dashboard
- assigns[:recent_comments].should == comments(:johans_repos, :johans_repos2)
+
+ comment_list = comments(:johans_repos, :johans_repos2)
+
+ puts comment_list.inspect
+
+ comment_list.each { |comment|
+ assigns[:recent_comments].include?(comment).should == true
+ }
end
it "gets a list of all the clones made of current_users repositories" do |