From 095164bc715afb9404906d9d7856cfe085d88d28 Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 10:19:13 -0700 Subject: [PATCH 1/7] change factory_girl to factory_bot - rename --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index cd9aba56..7aec00c7 100644 --- a/Gemfile +++ b/Gemfile @@ -69,7 +69,7 @@ group :test do gem 'rails-dom-testing', git: 'https://github.com/rails/rails-dom-testing', ref: 'a64f30514ee65f172c43f42cfd4500b5e11a561a' - gem "factory_girl_rails" + gem "factory_bot_rails" gem "rspec-expectations" gem "database_cleaner" gem "mocha", :require => false diff --git a/Gemfile.lock b/Gemfile.lock index 6ddffc36..7239979b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,10 +85,10 @@ GEM erubis (2.7.0) eventmachine (1.2.7) execjs (2.7.0) - factory_girl (4.9.0) + factory_bot (4.9.0) activesupport (>= 3.0.0) - factory_girl_rails (4.9.0) - factory_girl (~> 4.9.0) + factory_bot_rails (4.9.0) + factory_bot (~> 4.9.0) railties (>= 3.0.0) ffi (1.9.25) font-awesome-sass (4.5.0) @@ -267,7 +267,7 @@ DEPENDENCIES codeclimate-test-reporter coffee-rails (~> 4.1.0) database_cleaner - factory_girl_rails + factory_bot_rails font-awesome-sass (~> 4.5.0) htmlentities jquery-rails (~> 3.1.3) From a94861ef81456d5832d922b2a3beff3f9962f355 Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 10:32:35 -0700 Subject: [PATCH 2/7] gemfile update --- .Gemfile.lock.swp | Bin 0 -> 20480 bytes Gemfile | 2 +- Gemfile.lock | 14 +++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 .Gemfile.lock.swp diff --git a/.Gemfile.lock.swp b/.Gemfile.lock.swp new file mode 100644 index 0000000000000000000000000000000000000000..20d3e7e97fa2658e4f5146f88f45d1be880d5d51 GIT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6=xmD(u@kz z%fwr#C+>|(R209iU3NBVkhxF_rBuYlPpP8I0wgkvV&&b3QI~^eXD%=kCtWJlSM)zi zUCTE)ZSy>_J9|MKdycX{L}-Woz^# zw8OqrOG~S)I_n}5HDH$%FFN@cS@bLyW#)q5lxcAz;XPgL$}W^JW7}Ao*4Q958LU!X fceJtAPMbKh=6Prg9P01vH#Z~h{HA)Qj&T10(ydQP literal 0 HcmV?d00001 diff --git a/Gemfile b/Gemfile index 7aec00c7..b4c0c9c6 100644 --- a/Gemfile +++ b/Gemfile @@ -86,5 +86,5 @@ group :test do gem "simplecov" # get test coverage info on codeclimate - gem "codeclimate-test-reporter", group: :test, require: nil + gem "codeclimate-test-reporter", "1.0.7", group: :test, require: nil end diff --git a/Gemfile.lock b/Gemfile.lock index 7239979b..914cb645 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,14 +81,14 @@ GEM daemons (1.2.6) database_cleaner (1.7.0) diff-lcs (1.3) - docile (1.1.5) + docile (1.3.1) erubis (2.7.0) eventmachine (1.2.7) execjs (2.7.0) - factory_bot (4.9.0) + factory_bot (4.10.0) activesupport (>= 3.0.0) - factory_bot_rails (4.9.0) - factory_bot (~> 4.9.0) + factory_bot_rails (4.10.0) + factory_bot (~> 4.10.0) railties (>= 3.0.0) ffi (1.9.25) font-awesome-sass (4.5.0) @@ -128,7 +128,7 @@ GEM mini_portile2 (~> 2.1.0) nokogumbo (1.5.0) nokogiri - paperclip (6.0.0) + paperclip (6.1.0) activemodel (>= 4.2.0) activesupport (>= 4.2.0) mime-types @@ -245,7 +245,7 @@ GEM safe_yaml (>= 0.8.6) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.16) + uglifier (4.1.17) execjs (>= 0.3.0, < 3) unicode-display_width (1.4.0) uniform_notifier (1.11.0) @@ -264,7 +264,7 @@ DEPENDENCIES bcrypt (~> 3.1.7) bootstrap-sass (= 3.3.3) bullet - codeclimate-test-reporter + codeclimate-test-reporter (= 1.0.7) coffee-rails (~> 4.1.0) database_cleaner factory_bot_rails From fa7f2a777b0eb31add6286aa8b3a5ddf0eb93015 Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 10:57:11 -0700 Subject: [PATCH 3/7] assert_equal nil deprecated: replace with assert_nil --- .Gemfile.lock.swp | Bin 20480 -> 0 bytes .../recurring_todos_controller_test.rb | 2 +- test/controllers/todos_controller_test.rb | 4 ++-- test/models/recurring_todo_test.rb | 8 ++++---- test/models/rich_message_extractor_test.rb | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 .Gemfile.lock.swp diff --git a/.Gemfile.lock.swp b/.Gemfile.lock.swp deleted file mode 100644 index 20d3e7e97fa2658e4f5146f88f45d1be880d5d51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20480 zcmeI4Ym6jS6@UwQD{rDE7_oSdNcVKlYiHMGS!I`XkwsW`MZ{!MU0pp>JKbHq)!j2Y zD*=sB9s&`FztjX&2*x0WAp9UvkSqii4T&)k#efj;LDz)I($|pB(@u$lbkIzY-_qU6}YcD;m<~1ihFG}N39v|$}3_87}bFf^V zcfC|N8YcC)Jv&-Y!ucre_WF&+Xfp|eW-krG`R=Is+7z`KaWg8DG=K1#iyVan3JDxg z0{vd2G=01`K2}vr{j4+3@J~Hu`vHp-iG>6T2^112Bv448kU$}ULIQ;Z3JJWuB+%;| z?%lwU-eHDyqxn8;==%us_ig6;rlIu1&EKb)?{}LDY(3_2@l{BmkU$}ULIQ;Z3JDYv zC?rrwppZZzfkFa>1PTfKA0!aeb)(aA0f7JCzW={T z_Q1XHb+{20;4`ou&W2;*_2WJ7akw9Dg%(@`>)=%Q?Qx#>BzzNYfqB>lYvE*g^XVT|wq+z5*h!lm#bI0p6|?Rh_gr{LRg6D&XtHo_Qu0FHyd9OZd0!_#m-+zj(@ zC9H=t;RN{Sk&FeNfbYW{unT5jJ)8~4z#Cl3ya;>XA@~}69y+icE`oF5B-qCV&2#V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KM^mseL$3ec*Q7ha%A0B;*l}6 z>c9Zpkj@jWZLw;mni(BK&$*qMMFi*kl8NJV3p@JEBF~Nxv0y!ROUPCJao&lpI%V{0r2~|lo(9e( zLagX@J9*j(A`c5suTM9w`k*O3lK}p6SHZu1vD1 zYFaDBDilBm-ViEa{L`y*c^X}{p3OOLkjHAb92vzc9u*E z>rE!IP0fX~69fO1lIg@i(kli{4GyalEMF%BXDeklGj+Sk7rSb7MV`rVb2cS@q84yG z7GvpVXFrx-Ymc*WPVbi2rgFMLGjZ)&f*V+=0wE?tlif)cqf|Q_Dd>VEVy^Adv3{V~TT^hAX zvJ=-Jf=JDs(RRMHjx2v&(5A*FM-6RCTzx9=g{tVD)^THGvZ^d0FLty%cj~L`im|?F zFfXA_>%7=hsYP{XdZ5Td<}vRm&Yph!k$l=<6=xmD(u@kz z%fwr#C+>|(R209iU3NBVkhxF_rBuYlPpP8I0wgkvV&&b3QI~^eXD%=kCtWJlSM)zi zUCTE)ZSy>_J9|MKdycX{L}-Woz^# zw8OqrOG~S)I_n}5HDH$%FFN@cS@bLyW#)q5lxcAz;XPgL$}W^JW7}Ao*4Q958LU!X fceJtAPMbKh=6Prg9P01vH#Z~h{HA)Qj&T10(ydQP diff --git a/test/controllers/recurring_todos_controller_test.rb b/test/controllers/recurring_todos_controller_test.rb index 7ce7f335..6c1d8a17 100644 --- a/test/controllers/recurring_todos_controller_test.rb +++ b/test/controllers/recurring_todos_controller_test.rb @@ -224,7 +224,7 @@ class RecurringTodosControllerTest < ActionController::TestCase assert_equal UserTime.new(user).midnight(target_date), new_todo.due # show_from should be nil since now+4.days-10.days is in the past - assert_equal nil, new_todo.show_from + assert_nil new_todo.show_from end def test_last_sunday_of_march diff --git a/test/controllers/todos_controller_test.rb b/test/controllers/todos_controller_test.rb index 1781a0b0..ec203975 100644 --- a/test/controllers/todos_controller_test.rb +++ b/test/controllers/todos_controller_test.rb @@ -32,9 +32,9 @@ class TodosControllerTest < ActionController::TestCase p.save! login_as(:admin_user) get :index - assert_equal nil, assigns['project_not_done_counts'][projects(:timemachine).id] + assert_nil assigns['project_not_done_counts'][projects(:timemachine).id] assert_equal 2, assigns['context_not_done_counts'][contexts(:call).id] - assert_equal nil, assigns['context_not_done_counts'][contexts(:lab).id] + assert_nil assigns['context_not_done_counts'][contexts(:lab).id] end def test_not_done_counts_after_hiding_project diff --git a/test/models/recurring_todo_test.rb b/test/models/recurring_todo_test.rb index 79ef192f..8a59bf39 100644 --- a/test/models/recurring_todo_test.rb +++ b/test/models/recurring_todo_test.rb @@ -30,8 +30,8 @@ class RecurringTodoTest < ActiveSupport::TestCase @every_day.target='show_from_date' # when recurrence is targeted on show_from, due date should remain nil - assert_equal nil, @every_day.get_due_date(nil) - assert_equal nil, @every_day.get_due_date(@today-3.days) + assert_nil @every_day.get_due_date(nil) + assert_nil @every_day.get_due_date(@today-3.days) # check show from get the next day assert_equal_dmy @today, @every_day.get_show_from_date(@today-1.days) @@ -40,7 +40,7 @@ class RecurringTodoTest < ActiveSupport::TestCase @every_day.target='due_date' # when target on due_date, show_from is relative to due date unless show_always is true @every_day.show_always = true - assert_equal nil, @every_day.get_show_from_date(@today-1.days) + assert_nil @every_day.get_show_from_date(@today-1.days) @every_day.show_always = false @every_day.show_from_delta=10 @@ -52,7 +52,7 @@ class RecurringTodoTest < ActiveSupport::TestCase # when show_from is nil, show always (happend in tests) @every_day.show_from_delta=nil - assert_equal nil, @every_day.get_show_from_date(@today+9.days) + assert_nil @every_day.get_show_from_date(@today+9.days) # TODO: show_from has no use case for daily pattern. Need to test on # weekly/monthly/yearly diff --git a/test/models/rich_message_extractor_test.rb b/test/models/rich_message_extractor_test.rb index cecdbdcd..828234e6 100644 --- a/test/models/rich_message_extractor_test.rb +++ b/test/models/rich_message_extractor_test.rb @@ -21,7 +21,7 @@ class RichMessageExtractorTest < Minitest::Test extractor = RichMessageExtractor.new(message) assert_equal "ohai", extractor.description assert_equal "some-context", extractor.context - assert_equal nil, extractor.project + assert_nil extractor.project end def test_message_without_context @@ -37,7 +37,7 @@ class RichMessageExtractorTest < Minitest::Test extractor = RichMessageExtractor.new(message) assert_equal "ohai", extractor.description assert_equal "", extractor.context - assert_equal nil, extractor.project + assert_nil extractor.project end def test_message_without_anything @@ -45,7 +45,7 @@ class RichMessageExtractorTest < Minitest::Test extractor = RichMessageExtractor.new(message) assert_equal "", extractor.description assert_equal "", extractor.context - assert_equal nil, extractor.project + assert_nil extractor.project end def test_message_with_just_a_context @@ -53,7 +53,7 @@ class RichMessageExtractorTest < Minitest::Test extractor = RichMessageExtractor.new(message) assert_equal "", extractor.description assert_equal "some-context", extractor.context - assert_equal nil, extractor.project + assert_nil extractor.project end def test_message_with_tags @@ -65,7 +65,7 @@ class RichMessageExtractorTest < Minitest::Test def test_message_with_no_tags message = "no tags" extractor = RichMessageExtractor.new(message) - assert_equal nil, extractor.tags + assert_nil extractor.tags end def test_message_with_due_date @@ -77,7 +77,7 @@ class RichMessageExtractorTest < Minitest::Test def test_message_with_no_due_date message = "no date" extractor = RichMessageExtractor.new(message) - assert_equal nil, extractor.due + assert_nil extractor.due end def test_message_with_show_from @@ -89,7 +89,7 @@ class RichMessageExtractorTest < Minitest::Test def test_message_with_no_show_from message = "no tickler" extractor = RichMessageExtractor.new(message) - assert_equal nil, extractor.show_from + assert_nil extractor.show_from end def test_message_with_star From 429a22778caf450e1f9c9956ba58806515c1faad Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 11:31:50 -0700 Subject: [PATCH 4/7] hack to remove minitest deprecation warnings --- test/models/project_from_todo_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/models/project_from_todo_test.rb b/test/models/project_from_todo_test.rb index 6bdc1f07..ee06d783 100644 --- a/test/models/project_from_todo_test.rb +++ b/test/models/project_from_todo_test.rb @@ -9,7 +9,11 @@ class ProjectFromTodoTest < ActiveSupport::TestCase project = ProjectFromTodo.new(todo).create assert_equal project.name, todo.description assert_equal project.description, todo.notes - assert_equal project.default_context, todo.context + if project.default.context.nil? + assert_nil todo.context + else + assert_equal project.default_context, todo.context + end end def test_retain_tags_from_todo From 04d5e764b237ca4330d83868790fe2748fb57ef9 Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 11:43:48 -0700 Subject: [PATCH 5/7] typo fix --- test/controllers/preferences_controller_test.rb | 6 +++++- test/models/project_from_todo_test.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/controllers/preferences_controller_test.rb b/test/controllers/preferences_controller_test.rb index 3b7d617b..98efc207 100644 --- a/test/controllers/preferences_controller_test.rb +++ b/test/controllers/preferences_controller_test.rb @@ -57,7 +57,11 @@ class PreferencesControllerTest < ActionController::TestCase :prefs => { :date_format => "%m-%d-%Y", :week_starts => "0", :show_number_completed => "10", :show_completed_projects_in_sidebar => "false", :show_hidden_contexts_in_sidebar => "false", :staleness_starts => "14", :due_style => "1" }} updated_admin_user = users(:admin_user).reload - assert_equal old_password_hash, updated_admin_user.password + if old_password_hash.nil? + assert_nil updated_admin_user.password + else + assert_equal old_password_hash, updated_admin_user.password + end end end diff --git a/test/models/project_from_todo_test.rb b/test/models/project_from_todo_test.rb index ee06d783..ae7a7409 100644 --- a/test/models/project_from_todo_test.rb +++ b/test/models/project_from_todo_test.rb @@ -9,7 +9,7 @@ class ProjectFromTodoTest < ActiveSupport::TestCase project = ProjectFromTodo.new(todo).create assert_equal project.name, todo.description assert_equal project.description, todo.notes - if project.default.context.nil? + if project.default_context.nil? assert_nil todo.context else assert_equal project.default_context, todo.context From 589ee7516869eeaa1e1432636aef79be8dc17835 Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 11:52:01 -0700 Subject: [PATCH 6/7] another assert_nil hack --- test/models/project_from_todo_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/models/project_from_todo_test.rb b/test/models/project_from_todo_test.rb index ae7a7409..269d5e66 100644 --- a/test/models/project_from_todo_test.rb +++ b/test/models/project_from_todo_test.rb @@ -8,7 +8,11 @@ class ProjectFromTodoTest < ActiveSupport::TestCase todo = todos(:upgrade_rails) project = ProjectFromTodo.new(todo).create assert_equal project.name, todo.description - assert_equal project.description, todo.notes + if project.desription.nil? + assert_nil todo.notes + else + assert_equal project.description, todo.notes + end if project.default_context.nil? assert_nil todo.context else From a92317f0b5d15a67fe65c942a69bd4e7008db959 Mon Sep 17 00:00:00 2001 From: ericmoon Date: Thu, 2 Aug 2018 11:58:56 -0700 Subject: [PATCH 7/7] stupid typos --- test/models/project_from_todo_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/models/project_from_todo_test.rb b/test/models/project_from_todo_test.rb index 269d5e66..6149203b 100644 --- a/test/models/project_from_todo_test.rb +++ b/test/models/project_from_todo_test.rb @@ -8,7 +8,7 @@ class ProjectFromTodoTest < ActiveSupport::TestCase todo = todos(:upgrade_rails) project = ProjectFromTodo.new(todo).create assert_equal project.name, todo.description - if project.desription.nil? + if project.description.nil? assert_nil todo.notes else assert_equal project.description, todo.notes