From c5a837c68984a77161620f7f8b4c66ad09beb876 Mon Sep 17 00:00:00 2001 From: nwb Date: Wed, 25 Jun 2014 16:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=BA=90=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 18 ++++---- Gemfile.lock | 11 +++-- db/schema.rb | 84 +++++++----------------------------- test/unit/attachment_test.rb | 4 ++ 4 files changed, 34 insertions(+), 83 deletions(-) diff --git a/Gemfile b/Gemfile index 330b4efdf..634af9683 100644 --- a/Gemfile +++ b/Gemfile @@ -25,6 +25,16 @@ group :development do end end +group :test do + # shoulda的版本做了改动 + #gem "shoulda", "~> 3.3.2" + gem "shoulda", "> 3.3.2" + gem "mocha", "~> 0.13.3" + gem 'capybara', '~> 2.0.0' + gem 'nokogiri', '< 1.6.0' +end + + # Gems used only for assets and not required # in production environments by default. group :assets do @@ -42,14 +52,6 @@ group :ldap do gem "net-ldap", "~> 0.3.1" end -group :test do - # shoulda的版本做了改动 - #gem "shoulda", "~> 3.3.2" - gem "shoulda", "> 3.3.2" - gem "mocha", "~> 0.13.3" - gem 'capybara', '~> 2.0.0' - gem 'nokogiri', '< 1.6.0' -end platforms :mri, :mingw do group :rmagick do diff --git a/Gemfile.lock b/Gemfile.lock index 1767afd4e..e52990e2a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,10 +68,9 @@ GEM coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.6.1) + coffee-script-source (1.7.0) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) + execjs (2.0.2) fastercsv (1.5.0) ffi (1.9.3-x86-mingw32) hike (1.2.3) @@ -124,7 +123,7 @@ GEM rmagick (2.13.2) ruby-openid (2.1.8) rubyzip (1.1.4) - sass (3.2.7) + sass (3.2.14) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) @@ -151,9 +150,9 @@ GEM polyglot polyglot (>= 0.3.1) tzinfo (0.3.37) - uglifier (1.0.3) + uglifier (2.4.0) execjs (>= 0.3.0) - multi_json (>= 1.0.2) + json (>= 1.8.0) websocket (1.0.7) xpath (1.0.0) nokogiri (~> 1.3) diff --git a/db/schema.rb b/db/schema.rb index 231347cd3..63020ad61 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -174,58 +174,6 @@ ActiveRecord::Schema.define(:version => 20140618020535) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -767,18 +715,18 @@ ActiveRecord::Schema.define(:version => 20140618020535) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false + t.string "subject", :null => false + t.text "content", :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -1013,13 +961,11 @@ ActiveRecord::Schema.define(:version => 20140618020535) do end create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "user_id" + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "activity" end create_table "user_statuses", :force => true do |t| diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb index c98a0cebd..83abee85b 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -53,6 +53,10 @@ class AttachmentTest < ActiveSupport::TestCase assert_equal 0, a.downloads assert_equal '1478adae0d4eb06d35897518540e25d6', a.digest + #新增的属性检查 + assert_equal 'txt',a.suffix_type + assert_equal 'txt',a.show_suffix_type + assert a.disk_directory assert_match %r{\A\d{4}/\d{2}\z}, a.disk_directory