From a31088cc1b2b1ebe7d62f28d3a570a1bf587fd72 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 10 Jan 2015 17:27:08 +0800 Subject: [PATCH 1/2] Signed-off-by: alan <547533434@qq.com> --- Gemfile | 155 +++--------------- app/views/homework_attach/new.html.erb | 5 +- public/stylesheets/scm.css | 2 + test/fixtures/activities.yml | 11 ++ test/fixtures/course_infos.yml | 10 ++ test/fixtures/course_statuses.yml | 15 ++ test/fixtures/schools.yml | 10 ++ test/fixtures/user_extensions.yml | 42 +++++ .../applied_project_controller_test.rb | 7 + .../apply_project_masters_controller_test.rb | 49 ++++++ .../attachment_type_edit_controller_test.rb | 7 + .../contestnotifications_controller_test.rb | 49 ++++++ test/functional/forums_controller_test.rb | 49 ++++++ test/functional/memos_controller_test.rb | 11 ++ test/functional/no_uses_controller_test.rb | 49 ++++++ .../notificationcomments_controller_test.rb | 7 + .../open_source_projects_controller_test.rb | 49 ++++++ .../softapplications_controller_test.rb | 49 ++++++ test/functional/test_controller_test.rb | 13 ++ .../web_footer_companies_controller_test.rb | 4 + test/unit/attachmentstype_test.rb | 7 + test/unit/contest_notification_test.rb | 4 + test/unit/contesting_softapplication_test.rb | 7 + test/unit/contestnotification_test.rb | 7 + test/unit/course_group_test.rb | 10 ++ test/unit/course_infos_test.rb | 7 + test/unit/course_status_test.rb | 7 + test/unit/forum_test.rb | 7 + .../helpers/applied_project_helper_test.rb | 4 + .../apply_project_masters_helper_test.rb | 4 + .../attachment_type_edit_helper_test.rb | 4 + .../contestnotifications_helper_test.rb | 4 + test/unit/helpers/courses_helper_test.rb | 12 ++ test/unit/helpers/forums_helper_test.rb | 4 + test/unit/helpers/memos_helper_test.rb | 4 + test/unit/helpers/no_uses_helper_test.rb | 4 + .../notificationcomments_helper_test.rb | 4 + .../open_source_projects_helper_test.rb | 4 + test/unit/helpers/school_helper_test.rb | 4 + .../helpers/softapplications_helper_test.rb | 4 + test/unit/helpers/stores_helper_test.rb | 4 + test/unit/helpers/test_helper_test.rb | 4 + test/unit/helpers/zipdown_helper_test.rb | 4 + test/unit/join_in_contest_test.rb | 7 + test/unit/journal_reply_test.rb | 7 + test/unit/memo_test.rb | 17 ++ test/unit/no_use_test.rb | 7 + test/unit/notificationcomments_test.rb | 7 + test/unit/open_source_project_test.rb | 7 + test/unit/option_number_test.rb | 4 + test/unit/project_score_test.rb | 4 + test/unit/relative_memo_test.rb | 7 + test/unit/school_test.rb | 7 + test/unit/softapplication_test.rb | 7 + test/unit/user_score_details_test.rb | 7 + test/unit/web_footer_company_test.rb | 4 + test/unit/web_footer_oranizer_test.rb | 4 + 57 files changed, 678 insertions(+), 135 deletions(-) create mode 100644 test/functional/applied_project_controller_test.rb create mode 100644 test/functional/apply_project_masters_controller_test.rb create mode 100644 test/functional/attachment_type_edit_controller_test.rb create mode 100644 test/functional/contestnotifications_controller_test.rb create mode 100644 test/functional/forums_controller_test.rb create mode 100644 test/functional/memos_controller_test.rb create mode 100644 test/functional/no_uses_controller_test.rb create mode 100644 test/functional/notificationcomments_controller_test.rb create mode 100644 test/functional/open_source_projects_controller_test.rb create mode 100644 test/functional/softapplications_controller_test.rb create mode 100644 test/functional/test_controller_test.rb create mode 100644 test/unit/attachmentstype_test.rb create mode 100644 test/unit/contesting_softapplication_test.rb create mode 100644 test/unit/contestnotification_test.rb create mode 100644 test/unit/course_infos_test.rb create mode 100644 test/unit/course_status_test.rb create mode 100644 test/unit/forum_test.rb create mode 100644 test/unit/helpers/applied_project_helper_test.rb create mode 100644 test/unit/helpers/apply_project_masters_helper_test.rb create mode 100644 test/unit/helpers/attachment_type_edit_helper_test.rb create mode 100644 test/unit/helpers/contestnotifications_helper_test.rb create mode 100644 test/unit/helpers/courses_helper_test.rb create mode 100644 test/unit/helpers/forums_helper_test.rb create mode 100644 test/unit/helpers/memos_helper_test.rb create mode 100644 test/unit/helpers/no_uses_helper_test.rb create mode 100644 test/unit/helpers/notificationcomments_helper_test.rb create mode 100644 test/unit/helpers/open_source_projects_helper_test.rb create mode 100644 test/unit/helpers/school_helper_test.rb create mode 100644 test/unit/helpers/softapplications_helper_test.rb create mode 100644 test/unit/helpers/stores_helper_test.rb create mode 100644 test/unit/helpers/test_helper_test.rb create mode 100644 test/unit/helpers/zipdown_helper_test.rb create mode 100644 test/unit/join_in_contest_test.rb create mode 100644 test/unit/journal_reply_test.rb create mode 100644 test/unit/memo_test.rb create mode 100644 test/unit/no_use_test.rb create mode 100644 test/unit/notificationcomments_test.rb create mode 100644 test/unit/open_source_project_test.rb create mode 100644 test/unit/relative_memo_test.rb create mode 100644 test/unit/school_test.rb create mode 100644 test/unit/softapplication_test.rb create mode 100644 test/unit/user_score_details_test.rb diff --git a/Gemfile b/Gemfile index 84d578acd..6bb141404 100644 --- a/Gemfile +++ b/Gemfile @@ -1,249 +1,136 @@ -source 'https://rubygems.org' +source 'http://ruby.taobao.org' +#source 'http://ruby.sdutlinux.org/' unless RUBY_PLATFORM =~ /w32/ -5 # unix-like only -6 gem 'iconv' -7 gem 'rubyzip' -8 gem 'zip-zip' -9 end -10 -11 + gem 'seems_rateable', path: 'lib/seems_rateable' -12 gem "rails", "3.2.13" -13 gem "jquery-rails", "~> 2.0.2" -14 gem "i18n", "~> 0.6.0" -15 gem "coderay", "~> 1.0.6" -16 gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] -17 gem "builder", "3.0.0" -18 gem 'acts-as-taggable-on', '2.4.1' -19 gem 'spreadsheet' -20 gem 'ruby-ole' -21 -22 + group :development do -23 gem 'better_errors', path: 'lib/better_errors' -24 gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler' -25 end -26 -27 + group :test do -28 gem "shoulda", "~> 3.5.0" -29 gem "mocha", "~> 1.1.0" -30 gem 'capybara', '~> 2.4.1' -31 gem 'nokogiri', '~> 1.6.3' -32 gem 'factory_girl', '~> 4.4.0' -33 gem 'selenium-webdriver', '~> 2.42.0' -34 -35 -36 + + platforms :mri, :mingw do -37 group :rmagick do -38 # RMagick 2 supports ruby 1.9 -39 # RMagick 1 would be fine for ruby 1.8 but Bundler does not support -40 # different requirements for the same gem on different platforms -41 gem "rmagick", ">= 2.0.0" -42 end -43 end -44 end -45 -46 + group :development, :test do -47 gem "guard-rails", '~> 0.5.3' -48 gem 'spork-testunit', '~> 0.0.8' -49 gem 'guard-spork', '~> 1.5.1' -50 gem 'guard-test', '~> 1.0.0' -51 gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ -52 gem 'pry' -53 gem 'pry-nav' -54 -55 + end -56 -57 -58 + + # Gems used only for assets and not required -59 # in production environments by default. -60 group :assets do -61 gem 'sass-rails', '~> 3.2.3' -62 gem 'coffee-rails', '~> 3.2.1' -63 -64 + # See https://github.com/sstephenson/execjs#readme for more supported runtimes -65 gem 'therubyracer', :platforms => :ruby -66 -67 + gem 'uglifier', '>= 1.0.3' -68 end -69 -70 + # Optional gem for LDAP authentication -71 group :ldap do -72 gem "net-ldap", "~> 0.3.1" -73 end -74 -75 -76 + + # Optional gem for OpenID authentication -77 group :openid do -78 gem "ruby-openid", "~> 2.1.4", :require => "openid" -79 gem "rack-openid" -80 end -81 -82 + # Optional gem for exporting the gantt to a PNG file, not supported with jruby -83 platforms :jruby do -84 # jruby-openssl is bundled with JRuby 1.7.0 -85 gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0' -86 gem "activerecord-jdbc-adapter", "1.2.5" -87 end -88 -89 + # Include database gems for the adapters found in the database -90 # configuration file -91 require 'erb' -92 require 'yaml' -93 database_file = File.join(File.dirname(__FILE__), "config/database.yml") -94 if File.exist?(database_file) -95 database_config = YAML::load(ERB.new(IO.read(database_file)).result) -96 adapters = database_config.values.map {|c| c['adapter']}.compact.uniq -97 if adapters.any? -98 adapters.each do |adapter| -99 case adapter -100 when 'mysql2' -101 gem "mysql2", "= 0.3.11", :platforms => [:mri, :mingw] -102 gem "activerecord-jdbcmysql-adapter", :platforms => :jruby -103 when 'mysql' -104 gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw] -105 gem "activerecord-jdbcmysql-adapter", :platforms => :jruby -106 when /postgresql/ -107 gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw] -108 gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby -109 when /sqlite3/ -110 gem "sqlite3", :platforms => [:mri, :mingw] -111 gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -112 when /sqlserver/ -113 gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw] -114 gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw] -115 else -116 warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems") -117 end -118 end -119 else -120 warn("No adapter found in config/database.yml, please configure it first") -121 end -122 else -123 warn("Please configure your config/database.yml first") -124 end -125 -126 + local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") -127 if File.exists?(local_gemfile) -128 puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v` -129 instance_eval File.read(local_gemfile) -130 end -131 -132 + # Load plugins' Gemfiles -133 Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| -134 puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` -135 instance_eval File.read(file) -136 -end \ No newline at end of file +end diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index 661e15d5b..77077f102 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -78,7 +78,10 @@   作品描述    :  - <%= f.text_area "description", :class => "w620", :style=>"width:432px;", :maxlength => 3000, :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%> + <%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%> +
+ +


diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css index 68ae4ece5..1bc0ed804 100644 --- a/public/stylesheets/scm.css +++ b/public/stylesheets/scm.css @@ -97,8 +97,10 @@ table.annotate td.author { background: inherit; } + table.annotate td.line-code { background-color: #fafafa; word-break: break-all;} + div.action_M { background: #fd8 } div.action_D { background: #f88 } div.action_A { background: #bfb } diff --git a/test/fixtures/activities.yml b/test/fixtures/activities.yml index 1e16c097f..1dfba5c5f 100644 --- a/test/fixtures/activities.yml +++ b/test/fixtures/activities.yml @@ -1,6 +1,16 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html one: +<<<<<<< HEAD + act_id: + act_type: MyString + user_id: + +two: + act_id: + act_type: MyString + user_id: +======= id: 1 act_id: 1 act_type: JournalsForMessage @@ -10,3 +20,4 @@ two: act_id: 2 act_type: JournalsForMessage user_id: 5 +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 diff --git a/test/fixtures/course_infos.yml b/test/fixtures/course_infos.yml index 47da91c97..97356bfb1 100644 --- a/test/fixtures/course_infos.yml +++ b/test/fixtures/course_infos.yml @@ -1,5 +1,14 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html +<<<<<<< HEAD +one: + typeId: 1 + typeName: MyString + +two: + typeId: 1 + typeName: MyString +======= courses_001_infos: id: 1 course_id: 1 @@ -13,3 +22,4 @@ courses_002_infos: created_at: 2013-09-30 15:36:00 updated_at: 2014-04-19 01:50:41 +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 diff --git a/test/fixtures/course_statuses.yml b/test/fixtures/course_statuses.yml index 069a31ae3..22f1276f0 100644 --- a/test/fixtures/course_statuses.yml +++ b/test/fixtures/course_statuses.yml @@ -1,10 +1,24 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html +<<<<<<< HEAD + +one: +======= courses_001_statuses: +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 changesets_count: 1 watchers_count: 1 course_id: 1 grade: 1.5 course_ac_para: 1 +<<<<<<< HEAD + +two: + changesets_count: 1 + watchers_count: 1 + course_id: 1 + grade: 1.5 + course_ac_para: 1 +======= created_at: 2013-09-30 15:36:00 updated_at: 2014-04-19 01:50:41 @@ -16,3 +30,4 @@ courses_002_statuses: course_ac_para: 1 created_at: 2013-09-30 15:36:00 updated_at: 2014-04-19 01:50:41 +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 diff --git a/test/fixtures/schools.yml b/test/fixtures/schools.yml index df2fc15ca..2c5dd365e 100644 --- a/test/fixtures/schools.yml +++ b/test/fixtures/schools.yml @@ -1,5 +1,14 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html +<<<<<<< HEAD +one: + name: + province: MyString + +two: + name: + province: MyString +======= school_117: id: 117 name: 国防科学技术大学 @@ -11,3 +20,4 @@ school_001: name: 摧毁地球人学校 province: 火星 logo_link: +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 diff --git a/test/fixtures/user_extensions.yml b/test/fixtures/user_extensions.yml index c8e6a02e4..904db0483 100644 --- a/test/fixtures/user_extensions.yml +++ b/test/fixtures/user_extensions.yml @@ -1,3 +1,44 @@ +<<<<<<< HEAD +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +person_one_extra: + id: 44 + user_id: 29 + birthday: "2013-09-30 21:19:25" + brief_introduction: nil + gender: 1 + location: "江苏" + occupation: "" + work_experience: nil + zip_code: nil + created_at: "2013-09-30 21:19:25" + updated_at: "2013-10-09 19:00:06" + technical_title: nil + identity: 2 + student_id: nil + teacher_realname: nil + student_realname: nil + location_city: "南京" + +person_mao_extra: + id: 22 + user_id: 193 + birthday: "2013-09-30 21:19:25" + brief_introduction: "期待..." + gender: 0 + location: "湖南长沙" + occupation: "国防科技大学计算机学院" + work_experience: nil + zip_code: nil + created_at: "2013-09-30 21:19:25" + updated_at: "2013-10-09 19:00:06" + technical_title: "教授" + identity: 0 + student_id: nil + teacher_realname: nil + student_realname: nil + location_city: nil +======= user_extension_006: id: 6 user_id: 6 @@ -55,3 +96,4 @@ user_extension_025: student_realname: 'ue_realname' location_city: 哈尔滨 school_id: 117 +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 diff --git a/test/functional/applied_project_controller_test.rb b/test/functional/applied_project_controller_test.rb new file mode 100644 index 000000000..7c73908ce --- /dev/null +++ b/test/functional/applied_project_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class AppliedProjectControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/functional/apply_project_masters_controller_test.rb b/test/functional/apply_project_masters_controller_test.rb new file mode 100644 index 000000000..3cad8dca6 --- /dev/null +++ b/test/functional/apply_project_masters_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ApplyProjectMastersControllerTest < ActionController::TestCase + setup do + @apply_project_master = apply_project_masters(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:apply_project_masters) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create apply_project_master" do + assert_difference('ApplyProjectMaster.count') do + post :create, apply_project_master: { } + end + + assert_redirected_to apply_project_master_path(assigns(:apply_project_master)) + end + + test "should show apply_project_master" do + get :show, id: @apply_project_master + assert_response :success + end + + test "should get edit" do + get :edit, id: @apply_project_master + assert_response :success + end + + test "should update apply_project_master" do + put :update, id: @apply_project_master, apply_project_master: { } + assert_redirected_to apply_project_master_path(assigns(:apply_project_master)) + end + + test "should destroy apply_project_master" do + assert_difference('ApplyProjectMaster.count', -1) do + delete :destroy, id: @apply_project_master + end + + assert_redirected_to apply_project_masters_path + end +end diff --git a/test/functional/attachment_type_edit_controller_test.rb b/test/functional/attachment_type_edit_controller_test.rb new file mode 100644 index 000000000..d71c8407f --- /dev/null +++ b/test/functional/attachment_type_edit_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class AttachmentTypeEditControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/functional/contestnotifications_controller_test.rb b/test/functional/contestnotifications_controller_test.rb new file mode 100644 index 000000000..948955a87 --- /dev/null +++ b/test/functional/contestnotifications_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ContestnotificationsControllerTest < ActionController::TestCase + setup do + @contestnotification = contestnotifications(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:contestnotifications) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create contestnotification" do + assert_difference('Contestnotification.count') do + post :create, contestnotification: { author_id: @contestnotification.author_id, comments_count: @contestnotification.comments_count, contest_id: @contestnotification.contest_id, description: @contestnotification.description, summary: @contestnotification.summary, title: @contestnotification.title } + end + + assert_redirected_to contestnotification_path(assigns(:contestnotification)) + end + + test "should show contestnotification" do + get :show, id: @contestnotification + assert_response :success + end + + test "should get edit" do + get :edit, id: @contestnotification + assert_response :success + end + + test "should update contestnotification" do + put :update, id: @contestnotification, contestnotification: { author_id: @contestnotification.author_id, comments_count: @contestnotification.comments_count, contest_id: @contestnotification.contest_id, description: @contestnotification.description, summary: @contestnotification.summary, title: @contestnotification.title } + assert_redirected_to contestnotification_path(assigns(:contestnotification)) + end + + test "should destroy contestnotification" do + assert_difference('Contestnotification.count', -1) do + delete :destroy, id: @contestnotification + end + + assert_redirected_to contestnotifications_path + end +end diff --git a/test/functional/forums_controller_test.rb b/test/functional/forums_controller_test.rb new file mode 100644 index 000000000..9b0438bd2 --- /dev/null +++ b/test/functional/forums_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ForumsControllerTest < ActionController::TestCase + setup do + @forum = forums(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:forums) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create forum" do + assert_difference('Forum.count') do + post :create, forum: { } + end + + assert_redirected_to forum_path(assigns(:forum)) + end + + test "should show forum" do + get :show, id: @forum + assert_response :success + end + + test "should get edit" do + get :edit, id: @forum + assert_response :success + end + + test "should update forum" do + put :update, id: @forum, forum: { } + assert_redirected_to forum_path(assigns(:forum)) + end + + test "should destroy forum" do + assert_difference('Forum.count', -1) do + delete :destroy, id: @forum + end + + assert_redirected_to forums_path + end +end diff --git a/test/functional/memos_controller_test.rb b/test/functional/memos_controller_test.rb new file mode 100644 index 000000000..76c0e3748 --- /dev/null +++ b/test/functional/memos_controller_test.rb @@ -0,0 +1,11 @@ +require 'test_helper' + +class MemosControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end + def test_memo_create_fail + memo = Memo.create(:subject => nil) + assert true + end +end diff --git a/test/functional/no_uses_controller_test.rb b/test/functional/no_uses_controller_test.rb new file mode 100644 index 000000000..255b03dc4 --- /dev/null +++ b/test/functional/no_uses_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class NoUsesControllerTest < ActionController::TestCase + setup do + @no_use = no_uses(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:no_uses) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create no_use" do + assert_difference('NoUse.count') do + post :create, no_use: { } + end + + assert_redirected_to no_use_path(assigns(:no_use)) + end + + test "should show no_use" do + get :show, id: @no_use + assert_response :success + end + + test "should get edit" do + get :edit, id: @no_use + assert_response :success + end + + test "should update no_use" do + put :update, id: @no_use, no_use: { } + assert_redirected_to no_use_path(assigns(:no_use)) + end + + test "should destroy no_use" do + assert_difference('NoUse.count', -1) do + delete :destroy, id: @no_use + end + + assert_redirected_to no_uses_path + end +end diff --git a/test/functional/notificationcomments_controller_test.rb b/test/functional/notificationcomments_controller_test.rb new file mode 100644 index 000000000..21496467e --- /dev/null +++ b/test/functional/notificationcomments_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class NotificationcommentsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/functional/open_source_projects_controller_test.rb b/test/functional/open_source_projects_controller_test.rb new file mode 100644 index 000000000..9b33a8b1f --- /dev/null +++ b/test/functional/open_source_projects_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class OpenSourceProjectsControllerTest < ActionController::TestCase + setup do + @open_source_project = open_source_projects(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:open_source_projects) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create open_source_project" do + assert_difference('OpenSourceProject.count') do + post :create, open_source_project: { String: @open_source_project.String } + end + + assert_redirected_to open_source_project_path(assigns(:open_source_project)) + end + + test "should show open_source_project" do + get :show, id: @open_source_project + assert_response :success + end + + test "should get edit" do + get :edit, id: @open_source_project + assert_response :success + end + + test "should update open_source_project" do + put :update, id: @open_source_project, open_source_project: { String: @open_source_project.String } + assert_redirected_to open_source_project_path(assigns(:open_source_project)) + end + + test "should destroy open_source_project" do + assert_difference('OpenSourceProject.count', -1) do + delete :destroy, id: @open_source_project + end + + assert_redirected_to open_source_projects_path + end +end diff --git a/test/functional/softapplications_controller_test.rb b/test/functional/softapplications_controller_test.rb new file mode 100644 index 000000000..8c5611cb9 --- /dev/null +++ b/test/functional/softapplications_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class SoftapplicationsControllerTest < ActionController::TestCase + setup do + @softapplication = softapplications(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:softapplications) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create softapplication" do + assert_difference('Softapplication.count') do + post :create, softapplication: { android_min_version_available: @softapplication.android_min_version_available, app_type_id: @softapplication.app_type_id, app_type_name: @softapplication.app_type_name, description: @softapplication.description, name: @softapplication.name, user_id: @softapplication.user_id } + end + + assert_redirected_to softapplication_path(assigns(:softapplication)) + end + + test "should show softapplication" do + get :show, id: @softapplication + assert_response :success + end + + test "should get edit" do + get :edit, id: @softapplication + assert_response :success + end + + test "should update softapplication" do + put :update, id: @softapplication, softapplication: { android_min_version_available: @softapplication.android_min_version_available, app_type_id: @softapplication.app_type_id, app_type_name: @softapplication.app_type_name, description: @softapplication.description, name: @softapplication.name, user_id: @softapplication.user_id } + assert_redirected_to softapplication_path(assigns(:softapplication)) + end + + test "should destroy softapplication" do + assert_difference('Softapplication.count', -1) do + delete :destroy, id: @softapplication + end + + assert_redirected_to softapplications_path + end +end diff --git a/test/functional/test_controller_test.rb b/test/functional/test_controller_test.rb new file mode 100644 index 000000000..c262ffe53 --- /dev/null +++ b/test/functional/test_controller_test.rb @@ -0,0 +1,13 @@ +require 'test_helper' + +class TestControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end + test "get test index error" do + @request.env["REQUEST_URI"] = "" + get :index + assert_template :index + # assert_template layout: "layouts/base", partial: ["layouts/base_header","_base_header", 'layouts/base_footer', "_base_footer",] + end +end diff --git a/test/functional/web_footer_companies_controller_test.rb b/test/functional/web_footer_companies_controller_test.rb index fa251608d..d8f13ff84 100644 --- a/test/functional/web_footer_companies_controller_test.rb +++ b/test/functional/web_footer_companies_controller_test.rb @@ -1,6 +1,10 @@ require 'test_helper' +<<<<<<< HEAD:test/unit/relative_memo_to_open_source_project_test.rb +class RelativeMemoToOpenSourceProjectTest < ActiveSupport::TestCase +======= class WebFooterCompaniesControllerTest < ActionController::TestCase +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/functional/web_footer_companies_controller_test.rb # test "the truth" do # assert true # end diff --git a/test/unit/attachmentstype_test.rb b/test/unit/attachmentstype_test.rb new file mode 100644 index 000000000..0dcee4479 --- /dev/null +++ b/test/unit/attachmentstype_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class AttachmentstypeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/contest_notification_test.rb b/test/unit/contest_notification_test.rb index 04a714436..cf4ebf363 100644 --- a/test/unit/contest_notification_test.rb +++ b/test/unit/contest_notification_test.rb @@ -1,6 +1,10 @@ require 'test_helper' +<<<<<<< HEAD:test/unit/applied_project_test.rb +class AppliedProjectTest < ActiveSupport::TestCase +======= class ContestNotificationTest < ActiveSupport::TestCase +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/contest_notification_test.rb # test "the truth" do # assert true # end diff --git a/test/unit/contesting_softapplication_test.rb b/test/unit/contesting_softapplication_test.rb new file mode 100644 index 000000000..0c1364caa --- /dev/null +++ b/test/unit/contesting_softapplication_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ContestingSoftapplicationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/contestnotification_test.rb b/test/unit/contestnotification_test.rb new file mode 100644 index 000000000..22b8113c7 --- /dev/null +++ b/test/unit/contestnotification_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ContestnotificationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/course_group_test.rb b/test/unit/course_group_test.rb index c08ede23f..aad54b15a 100644 --- a/test/unit/course_group_test.rb +++ b/test/unit/course_group_test.rb @@ -1,3 +1,12 @@ +<<<<<<< HEAD:test/unit/bug_to_osp_test.rb +require 'test_helper' + +class BugToOspTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end +======= require 'test_helper' class CourseGroupTest < ActiveSupport::TestCase @@ -5,3 +14,4 @@ class CourseGroupTest < ActiveSupport::TestCase # assert true # end end +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/course_group_test.rb diff --git a/test/unit/course_infos_test.rb b/test/unit/course_infos_test.rb new file mode 100644 index 000000000..f20a519db --- /dev/null +++ b/test/unit/course_infos_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CourseInfosTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/course_status_test.rb b/test/unit/course_status_test.rb new file mode 100644 index 000000000..6c8fc11be --- /dev/null +++ b/test/unit/course_status_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CourseStatusTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/forum_test.rb b/test/unit/forum_test.rb new file mode 100644 index 000000000..a6f90e493 --- /dev/null +++ b/test/unit/forum_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ForumTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/helpers/applied_project_helper_test.rb b/test/unit/helpers/applied_project_helper_test.rb new file mode 100644 index 000000000..6ed46c9d2 --- /dev/null +++ b/test/unit/helpers/applied_project_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class AppliedProjectHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/apply_project_masters_helper_test.rb b/test/unit/helpers/apply_project_masters_helper_test.rb new file mode 100644 index 000000000..f1fbe853b --- /dev/null +++ b/test/unit/helpers/apply_project_masters_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ApplyProjectMastersHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/attachment_type_edit_helper_test.rb b/test/unit/helpers/attachment_type_edit_helper_test.rb new file mode 100644 index 000000000..d54aa165a --- /dev/null +++ b/test/unit/helpers/attachment_type_edit_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class AttachmentTypeEditHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/contestnotifications_helper_test.rb b/test/unit/helpers/contestnotifications_helper_test.rb new file mode 100644 index 000000000..d79755d82 --- /dev/null +++ b/test/unit/helpers/contestnotifications_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ContestnotificationsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/courses_helper_test.rb b/test/unit/helpers/courses_helper_test.rb new file mode 100644 index 000000000..829ae701e --- /dev/null +++ b/test/unit/helpers/courses_helper_test.rb @@ -0,0 +1,12 @@ +require File.expand_path('../../../test_helper', __FILE__) + +class CoursesHelperTest < ActionView::TestCase + include CoursesHelper + # test "test truth" do + # @project = Project.find_by_id 6834 + # teacherNum = teacherCount @project + # studentNum = studentCount @project + # assert_equal 1, teacherNum + # assert_equal 5, studentNum + # end +end diff --git a/test/unit/helpers/forums_helper_test.rb b/test/unit/helpers/forums_helper_test.rb new file mode 100644 index 000000000..deebfb03b --- /dev/null +++ b/test/unit/helpers/forums_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ForumsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/memos_helper_test.rb b/test/unit/helpers/memos_helper_test.rb new file mode 100644 index 000000000..44a7038ef --- /dev/null +++ b/test/unit/helpers/memos_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MemosHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/no_uses_helper_test.rb b/test/unit/helpers/no_uses_helper_test.rb new file mode 100644 index 000000000..405921005 --- /dev/null +++ b/test/unit/helpers/no_uses_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class NoUsesHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/notificationcomments_helper_test.rb b/test/unit/helpers/notificationcomments_helper_test.rb new file mode 100644 index 000000000..ecec0cbde --- /dev/null +++ b/test/unit/helpers/notificationcomments_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class NotificationcommentsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/open_source_projects_helper_test.rb b/test/unit/helpers/open_source_projects_helper_test.rb new file mode 100644 index 000000000..8ecd58615 --- /dev/null +++ b/test/unit/helpers/open_source_projects_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class OpenSourceProjectsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/school_helper_test.rb b/test/unit/helpers/school_helper_test.rb new file mode 100644 index 000000000..d571ccae9 --- /dev/null +++ b/test/unit/helpers/school_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class SchoolHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/softapplications_helper_test.rb b/test/unit/helpers/softapplications_helper_test.rb new file mode 100644 index 000000000..ad8173602 --- /dev/null +++ b/test/unit/helpers/softapplications_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class SoftapplicationsHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/stores_helper_test.rb b/test/unit/helpers/stores_helper_test.rb new file mode 100644 index 000000000..01b1643a7 --- /dev/null +++ b/test/unit/helpers/stores_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class StoresHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/test_helper_test.rb b/test/unit/helpers/test_helper_test.rb new file mode 100644 index 000000000..158276d03 --- /dev/null +++ b/test/unit/helpers/test_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TestHelperTest < ActionView::TestCase +end diff --git a/test/unit/helpers/zipdown_helper_test.rb b/test/unit/helpers/zipdown_helper_test.rb new file mode 100644 index 000000000..ca30cb362 --- /dev/null +++ b/test/unit/helpers/zipdown_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ZipdownHelperTest < ActionView::TestCase +end diff --git a/test/unit/join_in_contest_test.rb b/test/unit/join_in_contest_test.rb new file mode 100644 index 000000000..3d27c1a90 --- /dev/null +++ b/test/unit/join_in_contest_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class JoinInContestTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/journal_reply_test.rb b/test/unit/journal_reply_test.rb new file mode 100644 index 000000000..500f11a6f --- /dev/null +++ b/test/unit/journal_reply_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class JournalReplyTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/memo_test.rb b/test/unit/memo_test.rb new file mode 100644 index 000000000..659a1585b --- /dev/null +++ b/test/unit/memo_test.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +require 'test_helper' + +class MemoTest < ActiveSupport::TestCase + test "the truth" do + assert true + end + + def test_the_truth + assert true + end + + test "should not save memo without content" do + memo = Memo.new + assert !memo.save, "assert, save memo without content." + end +end diff --git a/test/unit/no_use_test.rb b/test/unit/no_use_test.rb new file mode 100644 index 000000000..4e4e903de --- /dev/null +++ b/test/unit/no_use_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class NoUseTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/notificationcomments_test.rb b/test/unit/notificationcomments_test.rb new file mode 100644 index 000000000..798084efb --- /dev/null +++ b/test/unit/notificationcomments_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class NotificationcommentsTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/open_source_project_test.rb b/test/unit/open_source_project_test.rb new file mode 100644 index 000000000..db44aad6e --- /dev/null +++ b/test/unit/open_source_project_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OpenSourceProjectTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/option_number_test.rb b/test/unit/option_number_test.rb index 758de74b0..fb271f927 100644 --- a/test/unit/option_number_test.rb +++ b/test/unit/option_number_test.rb @@ -1,6 +1,10 @@ require 'test_helper' +<<<<<<< HEAD:test/functional/school_controller_test.rb +class SchoolControllerTest < ActionController::TestCase +======= class OptionNumberTest < ActiveSupport::TestCase +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/option_number_test.rb # test "the truth" do # assert true # end diff --git a/test/unit/project_score_test.rb b/test/unit/project_score_test.rb index b305ac9ac..e600f1c15 100644 --- a/test/unit/project_score_test.rb +++ b/test/unit/project_score_test.rb @@ -1,6 +1,10 @@ require 'test_helper' +<<<<<<< HEAD:test/unit/apply_project_master_test.rb +class ApplyProjectMasterTest < ActiveSupport::TestCase +======= class ProjectScoreTest < ActiveSupport::TestCase +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/project_score_test.rb # test "the truth" do # assert true # end diff --git a/test/unit/relative_memo_test.rb b/test/unit/relative_memo_test.rb new file mode 100644 index 000000000..5f835a2a8 --- /dev/null +++ b/test/unit/relative_memo_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RelativeMemoTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/school_test.rb b/test/unit/school_test.rb new file mode 100644 index 000000000..e86105ea2 --- /dev/null +++ b/test/unit/school_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SchoolTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/softapplication_test.rb b/test/unit/softapplication_test.rb new file mode 100644 index 000000000..b3872eec5 --- /dev/null +++ b/test/unit/softapplication_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SoftapplicationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/user_score_details_test.rb b/test/unit/user_score_details_test.rb new file mode 100644 index 000000000..657a9c2f7 --- /dev/null +++ b/test/unit/user_score_details_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserScoreDetailsTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/web_footer_company_test.rb b/test/unit/web_footer_company_test.rb index 2233524d4..3359a7872 100644 --- a/test/unit/web_footer_company_test.rb +++ b/test/unit/web_footer_company_test.rb @@ -1,6 +1,10 @@ require 'test_helper' +<<<<<<< HEAD:test/functional/user_score_controller_test.rb +class UserScoreControllerTest < ActionController::TestCase +======= class WebFooterCompanyTest < ActiveSupport::TestCase +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/web_footer_company_test.rb # test "the truth" do # assert true # end diff --git a/test/unit/web_footer_oranizer_test.rb b/test/unit/web_footer_oranizer_test.rb index 18d9edadd..80212c12e 100644 --- a/test/unit/web_footer_oranizer_test.rb +++ b/test/unit/web_footer_oranizer_test.rb @@ -1,6 +1,10 @@ require 'test_helper' +<<<<<<< HEAD:test/functional/zipdown_controller_test.rb +class ZipdownControllerTest < ActionController::TestCase +======= class WebFooterOranizerTest < ActiveSupport::TestCase +>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/web_footer_oranizer_test.rb # test "the truth" do # assert true # end From d65239ef484f71a3833c5ad861a2c22587907b58 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 10 Jan 2015 17:27:42 +0800 Subject: [PATCH 2/2] Signed-off-by: alan <547533434@qq.com> --- test/fixtures/activities.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fixtures/activities.yml b/test/fixtures/activities.yml index 1dfba5c5f..2a7842517 100644 --- a/test/fixtures/activities.yml +++ b/test/fixtures/activities.yml @@ -1,7 +1,7 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html one: -<<<<<<< HEAD + act_id: act_type: MyString user_id: @@ -10,7 +10,7 @@ two: act_id: act_type: MyString user_id: -======= + id: 1 act_id: 1 act_type: JournalsForMessage @@ -20,4 +20,4 @@ two: act_id: 2 act_type: JournalsForMessage user_id: 5 ->>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0 +