<% end -%>
diff --git a/app/views/todos/_collection.m.erb b/app/views/todos/_collection.m.erb
new file mode 100644
index 00000000..8d79bda0
--- /dev/null
+++ b/app/views/todos/_collection.m.erb
@@ -0,0 +1,8 @@
+<%=
+ settings[:show_container] = !collection.empty? || settings[:show_empty_containers]
+
+ todos_container(settings) do
+ todos_container_header(settings) +
+ todos_container_items(collection, settings)
+ end
+%>
\ No newline at end of file
From 6d468e229ef2cf9cb11e46cae036f269ea0ce26b Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 2 May 2014 11:26:10 -0400
Subject: [PATCH 06/55] Use latest Tolk release, which supports Rails 4
---
Gemfile | 2 +-
Gemfile.lock | 13 ++++---------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/Gemfile b/Gemfile
index 4a2bffd0..34284496 100644
--- a/Gemfile
+++ b/Gemfile
@@ -44,7 +44,7 @@ gem 'bcrypt-ruby', '~> 3.0.0'
group :development do
gem "yard"
- gem "tolk", git: 'https://github.com/tolk/tolk'
+ gem 'tolk', '>=1.5.0'
gem "bullet"
gem "rack-mini-profiler"
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 8bc8c494..ca09c01f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -14,14 +14,6 @@ GIT
actionpack-xml_parser (1.0.1)
actionpack (>= 4.0.0, < 5)
-GIT
- remote: https://github.com/tolk/tolk
- revision: 06f99b3b747f2f8f7297fa35ec9c9d5f38eaada6
- specs:
- tolk (1.4.00)
- safe_yaml (~> 0.8)
- will_paginate
-
GEM
remote: https://rubygems.org/
specs:
@@ -192,6 +184,9 @@ GEM
atomic (>= 1.1.7, < 2)
tilt (1.4.1)
timecop (0.6.3)
+ tolk (1.5.0)
+ safe_yaml (~> 0.8)
+ will_paginate
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
@@ -242,7 +237,7 @@ DEPENDENCIES
swf_fu
therubyracer
timecop (~> 0.6.2)
- tolk!
+ tolk (>= 1.5.0)
uglifier (>= 1.3.0)
will_paginate
yard
From d48d49790aced583d00effac1c475d323fb6b8e4 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Mon, 5 May 2014 22:50:25 -0400
Subject: [PATCH 07/55] Remove sample SQLite databases
They're out of date, SQLite isn't the default database driver, and
they're not mentioned in the documentation.
---
db/tracks-blank.sqlite3.db | Bin 54272 -> 0 bytes
db/tracks-example.sqlite3.db | Bin 56320 -> 0 bytes
db/tracks-test.sqlite3.db | Bin 54272 -> 0 bytes
3 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 db/tracks-blank.sqlite3.db
delete mode 100644 db/tracks-example.sqlite3.db
delete mode 100644 db/tracks-test.sqlite3.db
diff --git a/db/tracks-blank.sqlite3.db b/db/tracks-blank.sqlite3.db
deleted file mode 100644
index aa3388a9d51408c73231d479782ff5eb388a3fc4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 54272
zcmeHQdu$xXdEc2?aw&<_k&>yiB-1<{MTuvM;_lw=J=6*o?a+=IJ#0Oi2yS{^-Yv5Iinf2WMG&AyQMW+b08RP|5TtF|
zv_;)N`pxX^-R`}3WG(8<&f@Ny+ixDmRi
zCJ4fH`0DWWueaa_@^9LH2iT#X*M+6;%#Hx-0QocOp_32De~^DA-zWb_zC-?o{H4bZ
z#o;#`0gk}`34x_E5Pkj>kS9+7i5>+qeHh5m2_Tc>Kn@)Ma&VO1U%)d$XT2ofB7a1F
zpS(-HM&2R6O@5R7I{6jyMe+sm2Kg-6A`U5&4Pua&$Zc|+Tqe(wizH1HvPkC1EICe&
zk_jRagg?MP!r#U3;orkw!M}!o0pG_azKK`xG6?0@a3e5z0Vh;hQDqIjX;qgqlUbi5
zXBAnO^~_|3aTK`M6&WsNGTp|JCsPehT20I8B!rvP8=RD?$Qe~js*_rSqpK+;tI8lN
z+2AO$2KS1hPO6L}gJ4xjsYxY0sZfrbmGz_oS6WdfWuK#@K%117np|#hl8}b3r8QkV
zkEgVhxCB%e&jHoMMW9LX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a/db/tracks-test.sqlite3.db b/db/tracks-test.sqlite3.db
deleted file mode 100644
index 6abee81b725f548a5cafd67d804fdf4aa800f785..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 54272
zcmeHQdu$s=df%B@in1()avXof$xHLeYNO0Fn5TuVJ
z*ETtz{bqKTTvC**ICjpqW*SxvYYy3;
zhM#i;I07FJfw3nb{penB9)A>^@J?`cJpj(m0dNNU!RhM*r#C>aq0;k%Bft^Zf(X$1
zkJ0Z6_&sp=aW^Ay{RHk2&b)X)jT;GFHB8OWwV0laWn?*#h|6*;XT%L9t7%6k^6_JH
z)_J2mlUpp!TZ;=9D`|CpHKW=m&n{iPk~ukBNh{hlb0wo6E6wB=m3;Bcacdz{n$P!T
zP9C+*`DFfLdA67-Ci6z=L~Q=J^=zg*Z(m%PNlzS`K6h~;zhW$$(iT);^!)s(?3{IK
zeyUjOyLe7nx{$9=oVApr$IdP4C#9pc#f4MXjHwg$f|{*lr}DY%!tCV*W#-Dog;SS}
z=aco>!t|N!!c4Iba;sdNT0S|wR4JvWPFyo4i^tCvvPTzbE{b*>{!*rtw9`}bt7k7)
zrdXWgmOfj$3Suky>BWT^%Uqe5I=fVvpd2rrv?ux$NlK1M+L$6m6m?uu#+BIhZ3uw8
zF{Vnoq{U^!R3t4OODZuXnaSyibWGQ>l40gDcN$1m?pCqodRm!}Wu}U&edhV;lW8SZ
zI99r7(_)>!a7I5Row%HxDqcx1&s<5DXIIn8Rk$P5`q^bCj)zH~F`3T;9`T8ZMg7?F
zQ8}Z`F9R-5H?fct5k(o7<#9=7^`AT^klzM}9~=RWz{f&h9zP_YVT4d9geJim3XQ^;
z8INXJ;XC8Iqi#|4ATG;GJq)@JzOJ+4Pb9OE=bK&&q!;z7!Q8QD{yue80ic!tv
zjq1Ue6pb98JTYA3^M!2IECVNi>FP&IpRJo9>uS-w2^vPW1X7tLqfl(Yt!SDL?~NXtHkqqtu4>x(
zo8)-Ktfnp7Oc|M4!78V+rk$x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3|3PA7gnQBZJ|E>5)@G@^9
z1X%rNH9yE|evrKj0<8Xvtp4-;zqZihz>CTeXxaa``hWiY5B^Ya1hxnQ{`LQ?{*R+K
z==lF#@;3Pa`DgO?U`%
zn~*6#J_!T@B!rT%^dp24`>7j$gt|I(217{O*F$!onEn*=v@zzz4l_?Z#60Cm=E+g!
zNe5}NSUr
zEWsfs){vxllSDrN99JQx-X!UYEG3kfs%TA;rs#4KzTlgPHA%8WKj|yWit3Ui$X}6l
zMTL(FJ0vM7X{roI9R4kmtb2lau-A-QbLqR%P5-?nwxja)$Ubv}#=yZ~_&j75UnetaKmgk)v^LxJn5Z|)
zcumT+Lby@rhU2dJLn9c4oyL!No6pzFg%|2(%Fg7?l94JEma0arV3qAPgqSPMg_-Gd
b7bYX_r<2!9?nttR3B~0K*jhjiBhmi{MOCTJ
From e22c7a23ddf0e546280f3c05f1d7803d9f50981e Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Mon, 5 May 2014 22:57:30 -0400
Subject: [PATCH 08/55] Use correct server name in install doc
The builtin web server is WEBrick, not Mongrel.
---
doc/installation.textile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/installation.textile b/doc/installation.textile
index 0ae21f9e..190ea12b 100644
--- a/doc/installation.textile
+++ b/doc/installation.textile
@@ -27,7 +27,7 @@ Several third parties provide Tracks hosting as a service. A list of these provi
h3. Requirements
-The Tracks interface is accessed through a web browser, so you need to run a webserver to serve the Tracks pages up to you. This isn't as daunting as it sounds, however: Tracks ships with a built-in web server called Mongrel which you can run on your own computer to serve the Tracks application locally. If you want to be able to access Tracks from any computer connected to the Internet, then you need to install Tracks on a publicly accessible server, and you will probably be better off using a more robust web server such as "Apache":http://www.apache.org/ (using "modrails":http://www.modrails.com/) or "Lighttpd":http://www.lighttpd.net/ to serve the pages, particularly if it will be used by many people.
+The Tracks interface is accessed through a web browser, so you need to run a webserver to serve the Tracks pages up to you. This isn't as daunting as it sounds, however: Tracks ships with a built-in web server called WEBrick which you can run on your own computer to serve the Tracks application locally. If you want to be able to access Tracks from any computer connected to the Internet, then you need to install Tracks on a publicly accessible server, and you will probably be better off using a more robust web server such as "Apache":http://www.apache.org/ (using "modrails":http://www.modrails.com/) or "Lighttpd":http://www.lighttpd.net/ to serve the pages, particularly if it will be used by many people.
Tracks stores its data in a database, and you can either use SQLite3, MySQL or PostgreSQL. SQLite3 is the best choice for a single user (or a small number of users) on a local installation, while MySQL or PostgreSQL is better for multiple users on a remote installation.
From c652fb3082679594e021714a2987df2714db7540 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Mon, 5 May 2014 23:01:28 -0400
Subject: [PATCH 09/55] Update copyright year
---
README.md | 2 +-
doc/CHANGELOG | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c91461c3..9c659eb6 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# Tracks: a GTD(TM) web application, built with Ruby on Rails
-Copyright (C) 2004-2013 rousette.org.uk
+Copyright (C) 2004-2014 rousette.org.uk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index 115c35a9..7aebb556 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -10,7 +10,7 @@
* Original developer: bsag (http://www.rousette.org.uk/)
* Contributors: https://github.com/TracksApp/tracks/wiki/Contributors
* Version: 2.3devel
-* Copyright: (cc) 2004-2013 rousette.org.uk.
+* Copyright: (cc) 2004-2014 rousette.org.uk.
* License: GNU GPL
== Version 2.3devel
From 62eed01b0b66046d8d5b11675a1c6a312b609800 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Mon, 5 May 2014 23:15:51 -0400
Subject: [PATCH 10/55] Shorten verbiage about JumpBox
---
doc/installation.textile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/doc/installation.textile b/doc/installation.textile
index 190ea12b..d9926b28 100644
--- a/doc/installation.textile
+++ b/doc/installation.textile
@@ -17,9 +17,7 @@ cd tracks
h3. Easy installation options
-There are a few easy options if you are not confident about installing Tracks from source using these instructions. If you'd like to install Tracks on a local machine, try "BitNami":http://bitnami.org/stack/tracks -- it runs on Windows, Mac OS X and Linux. But they also support preconfigured virtual machines, including Amazon machine images.
-
-Alternatively, you could try "JumpBox":http://jumpbox.com/app/tracks, who provide a JumpBox for Tracks. JumpBoxes are pre-built, pre-configured virtual applications which run in a range of "Virtualization software applications":http://www.jumpbox.com/supported-virtualization-software. You just download the JumpBox (free), then open the file with your Virtualization software. Once the JumpBox has booted, it will give you a URL which you can visit in a browser. The software will then guide you through setting up an account. If you'd like to try out the JumpBox without installing it, you can use the 'Trial This JumpBox' button on the web site, which will let you play around with it to test it out. Furthermore, there is a free public AMI available for Amazon EC2. Just use any EC2 client and search for Tracks. This works in exactly the same way as the downloaded JumpBox you can easily migrate from a downloaded installation to an EC2 instance or back using the backup system of the JumpBox.
+There are a few easy options if you are not confident installing Tracks from source using these instructions. If you'd like to install Tracks on a local machine, try the packaged version offered by "Bitnami":http://bitnami.org/stack/tracks -- it runs on Windows, Mac OS X and Linux. If you'd like to run Tracks within a dedicated virtual machine, Bitnami and "JumpBox":http://jumpbox.com/app/tracks provide preconfigured virtual machine images.
Several third parties provide Tracks hosting as a service. A list of these providers can be found "on the wiki":https://github.com/TracksApp/tracks/wiki/Tracks-hosting. Please note that they may run older versions of Tracks.
From 1b43c556709e8e73bc7814e52870e6b7ea92b86b Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 6 May 2014 00:10:43 -0400
Subject: [PATCH 11/55] Rewrite much of the installation documentation
* Trim the fat and remove some duplication
* Reorder some things to improve the step-by-step flow
* Update some details such as required Ruby version (1.9.2+)
---
doc/installation.textile | 119 +++++++++++++++------------------------
1 file changed, 44 insertions(+), 75 deletions(-)
diff --git a/doc/installation.textile b/doc/installation.textile
index d9926b28..5ac6628d 100644
--- a/doc/installation.textile
+++ b/doc/installation.textile
@@ -1,12 +1,34 @@
h1. Installing Tracks
+The following instructions will guide you through the installation of Tracks from source.
-h2. Getting Tracks
+This description is intended for people installing Tracks from scratch. If you would like to upgrade an existing installation, please see the "upgrade documentation":upgrading.textile.
+Various Tracks users have contributed installation howtos for specific environments. They are "on the wiki":https://github.com/TracksApp/tracks/wiki/Installation-index.
+
+If you are not confident installing Tracks from source using these instructions, there are several alternative options provided by third parties:
+
+* If you'd like to install Tracks on a local machine, try the packaged version offered by "Bitnami":http://bitnami.org/stack/tracks -- it runs on Windows, Mac OS X and Linux.
+* If you'd like to run Tracks within a dedicated virtual machine, "JumpBox":http://jumpbox.com/app/tracks provides preconfigured virtual machine images.
+* Several providers offer individual Tracks user accounts. A list of these providers can be found "on the wiki":https://github.com/TracksApp/tracks/wiki/Tracks-hosting.
+
+(Please note that these third-party options may use older versions of Tracks.)
+
+
+h2. Prerequisites
+
+Tracks has a few software requirements that must be satisfied before installation:
+
+# *Ruby*. Tracks requires Ruby 1.9.2 or greater.
+# *Bundler*. Tracks requires a recent version of "Bundler":http://bundler.io to handle the installation of dependencies. Bundler is typically installed by running @gem install bundler@.
+# *Database*. Tracks is tested on "MySQL":http://www.mysql.com/, but "SQLite":http://www.sqlite.org/ and "PostgreSQL":http://www.postgresql.org/ can also be used. Of the three, SQLite requires the least configuration. Whatever your choice, the appropriate database software must be installed.
+
+
+h2. Get Tracks
There are two methods of downloading Tracks:
-# (Recommended for most people) Download the "zipped package":https://github.com/TracksApp/tracks/archive/v2.2.zip for the latest stable release (2.2) and unzip in your preferred location (e.g. @~/Sites@ for Mac OS X users).
+# (Recommended for most people) Download the "zipped package":https://github.com/TracksApp/tracks/archive/v2.2.2.zip for the latest stable release (2.2.2) and unzip in your preferred location (e.g. @~/Sites@ for Mac OS X users).
# If you want to live on the edge, you can get the latest development version from GitHub using git (bear in mind that this may be less stable than the released versions):
bc. cd ~/Sites
@@ -14,118 +36,65 @@ git clone https://github.com/TracksApp/tracks.git
cd tracks
-h3. Easy installation options
+h2. Set up the database
+_This section only applies if you will be using Tracks with a MySQL database._
-There are a few easy options if you are not confident installing Tracks from source using these instructions. If you'd like to install Tracks on a local machine, try the packaged version offered by "Bitnami":http://bitnami.org/stack/tracks -- it runs on Windows, Mac OS X and Linux. If you'd like to run Tracks within a dedicated virtual machine, Bitnami and "JumpBox":http://jumpbox.com/app/tracks provide preconfigured virtual machine images.
-
-Several third parties provide Tracks hosting as a service. A list of these providers can be found "on the wiki":https://github.com/TracksApp/tracks/wiki/Tracks-hosting. Please note that they may run older versions of Tracks.
-
-
-h3. Requirements
-
-
-The Tracks interface is accessed through a web browser, so you need to run a webserver to serve the Tracks pages up to you. This isn't as daunting as it sounds, however: Tracks ships with a built-in web server called WEBrick which you can run on your own computer to serve the Tracks application locally. If you want to be able to access Tracks from any computer connected to the Internet, then you need to install Tracks on a publicly accessible server, and you will probably be better off using a more robust web server such as "Apache":http://www.apache.org/ (using "modrails":http://www.modrails.com/) or "Lighttpd":http://www.lighttpd.net/ to serve the pages, particularly if it will be used by many people.
-
-Tracks stores its data in a database, and you can either use SQLite3, MySQL or PostgreSQL. SQLite3 is the best choice for a single user (or a small number of users) on a local installation, while MySQL or PostgreSQL is better for multiple users on a remote installation.
-
-
-h3. What is included with the Tracks package?
-
-# Tracks itself
-# An empty SQLite3 database, set up with the correct database schema
-
-
-h3. What you need to install
-
-If you don't want to (or can't) use one of the all in one installations, you'll need to install a few things, depending on your platform and your needs.
-
-# *Ruby*. Tracks requires either Ruby 1.8.7 or Ruby 1.9.x. Ruby 1.9.x is the recommended version. Please note that support for ruby 1.8.7 will be dropped after this release!
-# *RubyGems*. Tracks was tested on version 1.8.24. You may upgrade using @gem update --system@. The gems needed by Rails to interact with the database have to be compiled on the platform on which they will be run, so we cannot include them with the Tracks package, unlike some other gems. So you will need to "download":http://rubyforge.org/frs/?group_id=126 and install RubyGems (run @ruby setup.rb@ after extracting the package). If you use Linux, rubygems may be available throught your packaging system. Mac OS X users already have RubyGems and the SQLite3 gem already installed on their systems. Once installed you can use RubyGems to install the gems you need for your database. Run @bundle install --without development test@ from the directory you installed Tracks in. This will install all needed gems, including those for MySQL and Sqlite3. If you do not want one of them, you can comment it out in your @Gemfile@ which can be found in the root of the Tracks installation.
-# *Database*. The easiest option is to use SQLite3, as the database is included in the package. You may need to install it first for your platform (see "sqlite.org":http://sqlite.org/download.html for downloads and installation instructions). If you want to use MySQL, download and install a package for your platform from "MySQL.com":http://dev.mysql.com/downloads/mysql/5.0.html. The basic steps for Postgresql should be similar to those for MySQL, but they will not be discussed further here.
-
-
-Various Tracks users have contributed installation howtos for specific setups. They are "on the wiki":https://github.com/TracksApp/tracks/wiki/Installation-index.
-
-
-h2. Installation
-
-This description is intended for people installing Tracks from scratch. If you would like to upgrade an existing installation, please see the "upgrade documentation":upgrading.textile.
-
-# Unzip tracks and install in a directory
-# Decide on a database to use
-## SQLite3 - change database.yml to point to SQLite3 database. Make sure you add the complete path to the database. Remove the @mysql2@ gem from the Gemfile
-## MySQL - create new MySQL db and grant all privileges
-# Install the necessary prerequisites using Bundler
-# Configure some variables
-# Populate the database with the Tracks schema
-# Start the server
-# Visit Tracks in a browser
-# Customise Tracks
-
-
-h3. Unzip Tracks and install
-
-Unzip the package and move Tracks into the directory you want to run it from. For example, for Mac OS X users, @~/Sites@ is a good choice.
-
-
-h3. Decide on a database
-
-Before you go any further, you need to decide which database you will use. See the 'What you need to install' section for details on installing the required components for you choice of database.
-
-# *SQLite3*. All you need to do is make sure that you point Tracks to the included SQLite3 database in @/db@ in the next step, 'Configure variables'.
-# *MySQL*. Once you have MySQL installed, you need to create a database and database-user to use with Tracks. For this, you can use MySQL Administrator or go into a terminal and issue the following commands:
+You need to create a database and database-user to use with Tracks. For this, you can use MySQL Administrator or go into a terminal and issue the following commands:
bc. mysql -uroot -p
mysql> CREATE DATABASE tracks;
mysql> GRANT ALL PRIVILEGES ON tracks.* TO yourmysqluser@localhost \
IDENTIFIED BY 'password-goes-here' WITH GRANT OPTION;
-h3. Install the necessary prerequisites using Bundler
-Tracks makes use of several other Ruby libraries (known as 'gems') to provide additional functionality. The Bundler tool makes it easy for the gems that Tracks needs to be installed.
+h2. Install dependencies
+
+Tracks is built upon a number of Ruby libraries (known as 'gems'). The Bundler tool makes it easy to install all the gems that Tracks needs, and ensures that they are all the correct versions.
-# Make sure you have bundler on your system already. It can be installed by running @gem install bundler@
# Run the command @bundle install --without development test@ in the directory that you unzipped your Tracks download to.
# Wait for Bundler to finish installing the necessary gems that Tracks needs. This can take some time depending on the speed of your internet connection and the speed of the system you're installing Tracks on.
-h3. Configure variables
-# If you downloaded Tracks via GitHub, you need to duplicate the files @database.yml.tmpl@ and @site.yml.tmpl@ and remove the @*.tmpl@ extension from the duplicates. Once you've made those copies, edit the files as described in steps 2 and 3.
-# Open the file @/config/database.yml@ and edit the @production:@ section with the details of your database. If you are using MySQL the @adapter:@ line should read @adapter: mysql2@, @host: localhost@ (in the majority of cases), and your username and password should match those you assigned when you created the database. If you are using SQLite3, you should have only two lines under the production section: @adapter: sqlite3@ and @database: db/tracks-blank.db@.
-# Open the file @/config/site.yml@, and read through the settings to make sure that they suit your setup. In most cases, all you need to change are the @salt: "change-me"@ line (change the string "change-me" to some other string of your choice), the administrator email address (@admin_email@), and the time zone setting. For the time zone setting you can use the command @bundle exec rake time:zones:local@ to see all available timezones on your machine
+h2. Configure variables
+
+# In the @config@ folder, copy the files @database.yml.tmpl@ and @site.yml.tmpl@ to @database.yml@ and @site.yml@, respectively.
+# Open the file @config/database.yml@ and edit the @production:@ section with the details of your database. If you are using MySQL the @adapter:@ line should read @adapter: mysql2@, @host: localhost@ (in the majority of cases), and your username and password should match those you assigned when you created the database. If you are using SQLite3, you should have only two lines under the production section: @adapter: sqlite3@ and @database: db/tracks.db@.
+# Open the file @config/site.yml@, and read through the settings to make sure that they suit your setup. In most cases, all you need to change are the @salt: "change-me"@ line (change the string "change-me" to some other string of your choice), the administrator email address (@admin_email@), and the time zone setting. For the time zone setting you can use the command @bundle exec rake time:zones:local@ to see all available timezones on your machine
# If you are using Windows, you may need to check the 'shebang' lines (@#!/usr/bin/env ruby@) of the @/public/dispatch.*@ files and all the files in the @/script@ directory. They are set to @#!/usr/bin/env ruby@ by default. This should work for all Unix based setups (Linux or Mac OS X), but Windows users will probably have to change it to something like @#c:/ruby/bin/ruby@ to point to the Ruby binary on your system.
# If you intend to deploy Tracks with the built in webserver called WEBrick, you'll need to change @config.serve_static_assets@ to @true@ in @config/environments/production.rb@ in order for the images, stylesheets, and javascript files to be served correctly.
-h3. Populate your database with the Tracks schema
+h2. Populate your database with the Tracks schema
Open a terminal and change into the root of your Tracks directory. Enter the following command:
bc. bundle exec rake db:migrate RAILS_ENV=production
-This will update your database with the required schema for Tracks. If you are using SQLite3, it is not strictly necessary, because the SQLite3 database included with Tracks already has the schema included in it, but it should not do any harm to run the command (nothing will happen if it is up to date).
+This will set up your database with the required structure to hold Tracks' data.
-h3. Precompile assets
+
+h2. Precompile assets
Static assets (images, stylesheets, and javascript) need to be compiled in order for them to work correctly with the new asset pipeline feature in Rails. Precompiling your assets is as simple as running the following command while inside the Tracks root directory:
bc. bundle exec rake assets:precompile
-h3. Start the server
+
+h2. Start the server
While still in the Terminal inside the Tracks root directory, issue the following command:
bc. bundle exec rails server -e production
-If all goes well, you should see some text informing you that the WEBrick server is running: @=> Rails application starting in production on http://0.0.0.0:3000@. If you are already running other services on port 3000, you need to select a different port when running the server, using the @-p@ option. You can stop the server again by the key combination Ctrl-C.
+If all goes well, you should see some text informing you that the WEBrick server is running: @=> Rails application starting in production on http://0.0.0.0:3000@. If you are already running other services on port 3000, you need to select a different port when running the server, using the @-p@ option.
-h3. Visit Tracks in a browser
+h2. Visit Tracks in a browser
Visit @http://0.0.0.0:3000/signup@ in a browser (or whatever URL and port was reported when you started the server in the step above) and chose a user name and password for admin user. Once logged in as admin, you can add other (ordinary level) users. If you need to access Tracks from a mobile/cellular phone browser, visit @http://yourdomain.com/mobile/@. This mobile version is a special, lightweight version of Tracks, designed to use on a mobile browser.
-h3. Customise Tracks
+h2. Customise Tracks
Once logged in, add some Contexts and Projects, and then go ahead and add your actions. You might also want to visit the Preferences page to edit various settings to your liking. Have fun!
From 3d8cac43bc6b0db0fd46c67f2d64c04c3983aeb8 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 6 May 2014 20:00:16 -0400
Subject: [PATCH 12/55] Update Rails
---
Gemfile.lock | 54 +++++++++++++++++++++++++---------------------------
1 file changed, 26 insertions(+), 28 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index ca09c01f..aa2fafde 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -19,26 +19,26 @@ GEM
specs:
RedCloth (4.2.9)
aasm (3.1.1)
- actionmailer (4.0.3)
- actionpack (= 4.0.3)
+ actionmailer (4.0.5)
+ actionpack (= 4.0.5)
mail (~> 2.5.4)
- actionpack (4.0.3)
- activesupport (= 4.0.3)
+ actionpack (4.0.5)
+ activesupport (= 4.0.5)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
- activemodel (4.0.3)
- activesupport (= 4.0.3)
+ activemodel (4.0.5)
+ activesupport (= 4.0.5)
builder (~> 3.1.0)
- activerecord (4.0.3)
- activemodel (= 4.0.3)
+ activerecord (4.0.5)
+ activemodel (= 4.0.5)
activerecord-deprecated_finders (~> 1.0.2)
- activesupport (= 4.0.3)
+ activesupport (= 4.0.5)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
- activesupport (4.0.3)
- i18n (~> 0.6, >= 0.6.4)
+ activesupport (4.0.5)
+ i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
@@ -46,7 +46,6 @@ GEM
acts_as_list (0.4.0)
activerecord (>= 3.0)
arel (4.0.2)
- atomic (1.1.15)
bcrypt-ruby (3.0.1)
builder (3.1.4)
bullet (4.8.0)
@@ -114,7 +113,7 @@ GEM
minitest (4.7.5)
mocha (1.0.0)
metaclass (~> 0.0.1)
- multi_json (1.8.4)
+ multi_json (1.10.0)
multi_test (0.0.3)
mysql2 (0.3.15)
nokogiri (1.6.1)
@@ -125,22 +124,22 @@ GEM
rack (>= 1.1.3)
rack-test (0.6.2)
rack (>= 1.0)
- rails (4.0.3)
- actionmailer (= 4.0.3)
- actionpack (= 4.0.3)
- activerecord (= 4.0.3)
- activesupport (= 4.0.3)
+ rails (4.0.5)
+ actionmailer (= 4.0.5)
+ actionpack (= 4.0.5)
+ activerecord (= 4.0.5)
+ activesupport (= 4.0.5)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.0.3)
+ railties (= 4.0.5)
sprockets-rails (~> 2.0.0)
rails_autolink (1.1.5)
rails (> 3.1)
- railties (4.0.3)
- actionpack (= 4.0.3)
- activesupport (= 4.0.3)
+ railties (4.0.5)
+ actionpack (= 4.0.5)
+ activesupport (= 4.0.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (10.1.1)
+ rake (10.3.1)
ref (1.0.5)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
@@ -163,7 +162,7 @@ GEM
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
- sprockets (2.11.0)
+ sprockets (2.12.1)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
@@ -179,9 +178,8 @@ GEM
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
- thor (0.18.1)
- thread_safe (0.2.0)
- atomic (>= 1.1.7, < 2)
+ thor (0.19.1)
+ thread_safe (0.3.3)
tilt (1.4.1)
timecop (0.6.3)
tolk (1.5.0)
@@ -190,7 +188,7 @@ GEM
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.38)
+ tzinfo (0.3.39)
uglifier (2.4.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
From f58c02a63a7e8a2ead526ed35d9cebffaf847c89 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 6 May 2014 20:36:19 -0400
Subject: [PATCH 13/55] Update gems
---
Gemfile.lock | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index aa2fafde..2a915b74 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/cucumber/aruba
- revision: 99d8e6a5992af17b014783e775409bc3fd422273
+ revision: fccb412d18d699b7ecacd0da6b2e5338987cf4eb
specs:
aruba (0.5.4)
childprocess (>= 0.3.6)
@@ -48,9 +48,9 @@ GEM
arel (4.0.2)
bcrypt-ruby (3.0.1)
builder (3.1.4)
- bullet (4.8.0)
+ bullet (4.9.0)
activesupport
- uniform_notifier (>= 1.4.0)
+ uniform_notifier (~> 1.6.0)
cache_digests (0.3.1)
actionpack (>= 3.2)
thread_safe
@@ -60,7 +60,7 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- childprocess (0.5.1)
+ childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
codeclimate-test-reporter (0.3.0)
simplecov (>= 0.7.1, < 1.0.0)
@@ -71,12 +71,12 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
- cucumber (1.3.11)
+ cucumber (1.3.14)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
- multi_test (>= 0.0.2)
+ multi_test (>= 0.1.1)
cucumber-rails (1.4.0)
capybara (>= 1.1.2)
cucumber (>= 1.2.0)
@@ -109,18 +109,18 @@ GEM
treetop (~> 1.4.8)
metaclass (0.0.4)
mime-types (1.25.1)
- mini_portile (0.5.2)
+ mini_portile (0.5.3)
minitest (4.7.5)
mocha (1.0.0)
metaclass (~> 0.0.1)
multi_json (1.10.0)
- multi_test (0.0.3)
+ multi_test (0.1.1)
mysql2 (0.3.15)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
polyglot (0.3.4)
rack (1.5.2)
- rack-mini-profiler (0.9.0)
+ rack-mini-profiler (0.9.1)
rack (>= 1.1.3)
rack-test (0.6.2)
rack (>= 1.0)
@@ -143,16 +143,17 @@ GEM
ref (1.0.5)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
- rubyzip (1.1.0)
+ rubyzip (1.1.3)
safe_yaml (0.9.7)
sanitize (2.1.0)
nokogiri (>= 1.4.4)
- sass (3.2.14)
- sass-rails (4.0.1)
+ sass (3.2.19)
+ sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0)
- sass (>= 3.1.10)
- sprockets-rails (~> 2.0.0)
- selenium-webdriver (2.40.0)
+ sass (~> 3.2.0)
+ sprockets (~> 2.8, <= 2.11.0)
+ sprockets-rails (~> 2.0)
+ selenium-webdriver (2.41.0)
childprocess (>= 0.5.0)
multi_json (~> 1.0)
rubyzip (~> 1.0)
@@ -162,7 +163,7 @@ GEM
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
- sprockets (2.12.1)
+ sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
@@ -189,15 +190,15 @@ GEM
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.39)
- uglifier (2.4.0)
+ uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
- uniform_notifier (1.4.0)
+ uniform_notifier (1.6.1)
websocket (1.0.7)
will_paginate (3.0.5)
xpath (2.0.0)
nokogiri (~> 1.3)
- yard (0.8.7.3)
+ yard (0.8.7.4)
PLATFORMS
ruby
From 1b3543c5de8f1024b00cee3df0df5fae21273cb5 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 6 May 2014 21:51:39 -0400
Subject: [PATCH 14/55] Add stub for NullProject.persisted?
---
app/models/project.rb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/models/project.rb b/app/models/project.rb
index 834428b0..c59f8bd9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -175,4 +175,8 @@ class NullProject
""
end
+ def persisted?
+ false
+ end
+
end
From 4a3d5a74e64b34c799cf7de03e482a4f1f345a72 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Thu, 15 May 2014 22:35:28 -0400
Subject: [PATCH 15/55] Require only stdlib for password reset rake task
---
Gemfile | 1 -
Gemfile.lock | 2 --
lib/tasks/tracks.rake | 12 ++++++++----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Gemfile b/Gemfile
index 34284496..6e9e672a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -31,7 +31,6 @@ gem "htmlentities"
gem "swf_fu"
gem "rails_autolink"
gem "cache_digests"
-gem "highline" # for reset_password rake task
# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 2a915b74..918ab9fb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -95,7 +95,6 @@ GEM
ffi (1.9.3)
gherkin (2.12.2)
multi_json (~> 1.3)
- highline (1.6.21)
hike (1.2.3)
htmlentities (4.3.1)
i18n (0.6.9)
@@ -218,7 +217,6 @@ DEPENDENCIES
cucumber-rails
database_cleaner
factory_girl_rails
- highline
htmlentities
jquery-rails
json
diff --git a/lib/tasks/tracks.rake b/lib/tasks/tracks.rake
index 2a5ef952..f6efb97f 100644
--- a/lib/tasks/tracks.rake
+++ b/lib/tasks/tracks.rake
@@ -1,7 +1,7 @@
namespace :tracks do
desc 'Replace the password of USER with a new one.'
task :password => :environment do
- require "highline/import"
+ require "io/console"
user = User.find_by_login(ENV['USER'])
if user.nil?
@@ -10,14 +10,18 @@ namespace :tracks do
end
puts "Changing Tracks password for #{ENV['USER']}."
- password = ask("New password: ") { |q| q.echo = false }
- password_confirmation = ask('Retype new password: ') { |q| q.echo = false }
+ print "New password: "
+ password = STDIN.noecho(&:gets).chomp
+ print "\nRetype new password: "
+ password_confirmation = STDIN.noecho(&:gets).chomp
+ puts
begin
user.change_password(password, password_confirmation)
+ puts "Password changed."
rescue ActiveRecord::RecordInvalid
puts "Sorry, we couldn't change #{ENV['USER']}'s password: "
- user.errors.each_full { |msg| puts "- #{msg}\n" }
+ user.errors.full_messages.each { |msg| puts "- #{msg}\n" }
end
end
From beac5bffb0eaf091cd76c5311bf50b89c8e6a94f Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 11 Apr 2014 22:45:57 +0200
Subject: [PATCH 16/55] update to rails 4.1
---
Gemfile | 8 ++--
Gemfile.lock | 105 +++++++++++++++++++++++++++------------------------
2 files changed, 59 insertions(+), 54 deletions(-)
diff --git a/Gemfile b/Gemfile
index 6e9e672a..8d87f436 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,10 +1,10 @@
source 'https://rubygems.org'
-gem 'rails', '~>4.0.0'
-gem 'sass-rails', '~>4.0.0'
-gem 'coffee-rails', '~>4.0.0'
+gem 'rails', '~>4.1'
+gem 'sass-rails', '~>4.0'
+gem 'coffee-rails', '~>4.0'
-gem 'json'
+#gem 'json'
# todo: remove xml api
gem 'actionpack-xml_parser', git: 'https://github.com/rails/actionpack-xml_parser'
diff --git a/Gemfile.lock b/Gemfile.lock
index 918ab9fb..98c3355b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -19,35 +19,37 @@ GEM
specs:
RedCloth (4.2.9)
aasm (3.1.1)
- actionmailer (4.0.5)
- actionpack (= 4.0.5)
+ actionmailer (4.1.1)
+ actionpack (= 4.1.1)
+ actionview (= 4.1.1)
mail (~> 2.5.4)
- actionpack (4.0.5)
- activesupport (= 4.0.5)
- builder (~> 3.1.0)
- erubis (~> 2.7.0)
+ actionpack (4.1.1)
+ actionview (= 4.1.1)
+ activesupport (= 4.1.1)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
- activemodel (4.0.5)
- activesupport (= 4.0.5)
- builder (~> 3.1.0)
- activerecord (4.0.5)
- activemodel (= 4.0.5)
- activerecord-deprecated_finders (~> 1.0.2)
- activesupport (= 4.0.5)
- arel (~> 4.0.0)
- activerecord-deprecated_finders (1.0.3)
- activesupport (4.0.5)
+ actionview (4.1.1)
+ activesupport (= 4.1.1)
+ builder (~> 3.1)
+ erubis (~> 2.7.0)
+ activemodel (4.1.1)
+ activesupport (= 4.1.1)
+ builder (~> 3.1)
+ activerecord (4.1.1)
+ activemodel (= 4.1.1)
+ activesupport (= 4.1.1)
+ arel (~> 5.0.0)
+ activesupport (4.1.1)
i18n (~> 0.6, >= 0.6.9)
- minitest (~> 4.2)
- multi_json (~> 1.3)
+ json (~> 1.7, >= 1.7.7)
+ minitest (~> 5.1)
thread_safe (~> 0.1)
- tzinfo (~> 0.3.37)
+ tzinfo (~> 1.1)
acts_as_list (0.4.0)
activerecord (>= 3.0)
- arel (4.0.2)
+ arel (5.0.1.20140414130214)
bcrypt-ruby (3.0.1)
- builder (3.1.4)
+ builder (3.2.2)
bullet (4.9.0)
activesupport
uniform_notifier (~> 1.6.0)
@@ -71,17 +73,18 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
- cucumber (1.3.14)
+ cucumber (1.3.15)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1)
- cucumber-rails (1.4.0)
- capybara (>= 1.1.2)
- cucumber (>= 1.2.0)
- nokogiri (>= 1.5.0)
- rails (>= 3.0.0)
+ cucumber-rails (1.4.1)
+ capybara (>= 1.1.2, < 3)
+ cucumber (>= 1.3.8, < 2)
+ mime-types (~> 1.16)
+ nokogiri (~> 1.5)
+ rails (>= 3, < 5)
database_cleaner (1.2.0)
diff-lcs (1.2.5)
docile (1.1.3)
@@ -108,37 +111,39 @@ GEM
treetop (~> 1.4.8)
metaclass (0.0.4)
mime-types (1.25.1)
- mini_portile (0.5.3)
- minitest (4.7.5)
- mocha (1.0.0)
+ mini_portile (0.6.0)
+ minitest (5.3.4)
+ mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.10.0)
multi_test (0.1.1)
- mysql2 (0.3.15)
- nokogiri (1.6.1)
- mini_portile (~> 0.5.0)
+ mysql2 (0.3.16)
+ nokogiri (1.6.2.1)
+ mini_portile (= 0.6.0)
polyglot (0.3.4)
rack (1.5.2)
rack-mini-profiler (0.9.1)
rack (>= 1.1.3)
rack-test (0.6.2)
rack (>= 1.0)
- rails (4.0.5)
- actionmailer (= 4.0.5)
- actionpack (= 4.0.5)
- activerecord (= 4.0.5)
- activesupport (= 4.0.5)
+ rails (4.1.1)
+ actionmailer (= 4.1.1)
+ actionpack (= 4.1.1)
+ actionview (= 4.1.1)
+ activemodel (= 4.1.1)
+ activerecord (= 4.1.1)
+ activesupport (= 4.1.1)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.0.5)
- sprockets-rails (~> 2.0.0)
+ railties (= 4.1.1)
+ sprockets-rails (~> 2.0)
rails_autolink (1.1.5)
rails (> 3.1)
- railties (4.0.5)
- actionpack (= 4.0.5)
- activesupport (= 4.0.5)
+ railties (4.1.1)
+ actionpack (= 4.1.1)
+ activesupport (= 4.1.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (10.3.1)
+ rake (10.3.2)
ref (1.0.5)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
@@ -167,7 +172,7 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sprockets-rails (2.0.1)
+ sprockets-rails (2.1.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
@@ -188,7 +193,8 @@ GEM
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.39)
+ tzinfo (1.1.0)
+ thread_safe (~> 0.1)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
@@ -213,21 +219,20 @@ DEPENDENCIES
cache_digests
capybara
codeclimate-test-reporter
- coffee-rails (~> 4.0.0)
+ coffee-rails (~> 4.0)
cucumber-rails
database_cleaner
factory_girl_rails
htmlentities
jquery-rails
- json
mocha
mysql2
rack-mini-profiler
- rails (~> 4.0.0)
+ rails (~> 4.1)
rails_autolink
rspec-expectations
sanitize
- sass-rails (~> 4.0.0)
+ sass-rails (~> 4.0)
selenium-webdriver
simplecov
sqlite3
From 128da07fc2801d7f0d3827b0916ec6fdaa975c1e Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 11 Apr 2014 22:46:10 +0200
Subject: [PATCH 17/55] remove Digest deprecation warning
---
app/controllers/mailgun_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/mailgun_controller.rb b/app/controllers/mailgun_controller.rb
index 83e6fe78..614d185e 100644
--- a/app/controllers/mailgun_controller.rb
+++ b/app/controllers/mailgun_controller.rb
@@ -25,7 +25,7 @@ class MailgunController < ApplicationController
def verify
unless params['signature'] == OpenSSL::HMAC.hexdigest(
- OpenSSL::Digest::Digest.new('sha256'),
+ OpenSSL::Digest.new('sha256'),
SITE_CONFIG['mailgun_api_key'],
'%s%s' % [params['timestamp'], params['token']]
)
From 35cab99ceaef55d882e169dc7737f541ab733a7e Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 11 Apr 2014 22:46:59 +0200
Subject: [PATCH 18/55] switch to minitest from test/unit
not sure if this is the right change, but tests seem to run
---
test/minimal_test_helper.rb | 1 -
test/models/pie_chart_data_test.rb | 2 +-
test/models/rich_message_extractor_test.rb | 3 +--
test/models/staleness_test.rb | 2 +-
test/models/tag_cloud_test.rb | 2 +-
test/models/time_to_complete_test.rb | 2 +-
test/models/tracks_cli/tracks_api_test.rb | 2 +-
test/models/tracks_cli/tracks_xml_builder_test.rb | 2 +-
8 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/test/minimal_test_helper.rb b/test/minimal_test_helper.rb
index d1d73ae9..3a2676ca 100644
--- a/test/minimal_test_helper.rb
+++ b/test/minimal_test_helper.rb
@@ -1,5 +1,4 @@
ENV["RAILS_ENV"] ||= "test"
-require 'test/unit'
require 'mocha/setup'
$:.unshift File.dirname(File.dirname(__FILE__))
diff --git a/test/models/pie_chart_data_test.rb b/test/models/pie_chart_data_test.rb
index d5933d12..09ac2bc2 100644
--- a/test/models/pie_chart_data_test.rb
+++ b/test/models/pie_chart_data_test.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../minimal_test_helper')
require 'app/models/stats/pie_chart_data'
require 'active_support/core_ext/string'
-class Stats::PieChartDataTest < Test::Unit::TestCase
+class Stats::PieChartDataTest < Minitest::Test
def setup
xx = { :stats => { :other_actions_label => '(other)' } }
diff --git a/test/models/rich_message_extractor_test.rb b/test/models/rich_message_extractor_test.rb
index c2e2dba1..cecdbdcd 100644
--- a/test/models/rich_message_extractor_test.rb
+++ b/test/models/rich_message_extractor_test.rb
@@ -1,9 +1,8 @@
require 'date'
-require 'test/unit'
require 'active_support/core_ext/object/blank'
require_relative '../../app/services/rich_message_extractor.rb'
-class RichMessageExtractorTest < Test::Unit::TestCase
+class RichMessageExtractorTest < Minitest::Test
def test_message_with_all_options
message = "ohai@some-context~this-project>131012<131014#tag1#tag2*"
diff --git a/test/models/staleness_test.rb b/test/models/staleness_test.rb
index 0f119d87..976a8861 100644
--- a/test/models/staleness_test.rb
+++ b/test/models/staleness_test.rb
@@ -3,7 +3,7 @@ require_relative '../../lib/staleness'
require_relative '../../lib/user_time'
require 'timecop'
-class StalenessTest < Test::Unit::TestCase
+class StalenessTest < Minitest::Test
FakePrefs = Struct.new(:time_zone)
FakeUser = Struct.new(:time) do
def prefs
diff --git a/test/models/tag_cloud_test.rb b/test/models/tag_cloud_test.rb
index e52f70f6..ad46eadb 100644
--- a/test/models/tag_cloud_test.rb
+++ b/test/models/tag_cloud_test.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../minimal_test_helper')
require 'app/models/stats/tag_cloud'
-class TagCloudTest < Test::Unit::TestCase
+class TagCloudTest < Minitest::Test
FakeTag = Struct.new(:name, :count)
diff --git a/test/models/time_to_complete_test.rb b/test/models/time_to_complete_test.rb
index c4353736..7ab9896e 100644
--- a/test/models/time_to_complete_test.rb
+++ b/test/models/time_to_complete_test.rb
@@ -5,7 +5,7 @@ require 'app/models/stats/time_to_complete'
FakeTask = Struct.new(:created_at, :completed_at)
-class TimeToCompleteTest < Test::Unit::TestCase
+class TimeToCompleteTest < Minitest::Test
def now
@now ||= Time.utc(2013, 1, 2, 3, 4, 5)
diff --git a/test/models/tracks_cli/tracks_api_test.rb b/test/models/tracks_cli/tracks_api_test.rb
index d1b1de2d..dbe51523 100644
--- a/test/models/tracks_cli/tracks_api_test.rb
+++ b/test/models/tracks_cli/tracks_api_test.rb
@@ -4,7 +4,7 @@ require './doc/tracks_cli/tracks_api'
module TracksCli
- class TracksApiTest < Test::Unit::TestCase
+ class TracksApiTest < Minitest::Test
def test_https_detection
uri = URI.parse("https://tracks.example.com")
diff --git a/test/models/tracks_cli/tracks_xml_builder_test.rb b/test/models/tracks_cli/tracks_xml_builder_test.rb
index 8ef09baf..71b62571 100644
--- a/test/models/tracks_cli/tracks_xml_builder_test.rb
+++ b/test/models/tracks_cli/tracks_xml_builder_test.rb
@@ -4,7 +4,7 @@ require 'active_support/time_with_zone'
module TracksCli
- class TracksXmlBuilderTest < Test::Unit::TestCase
+ class TracksXmlBuilderTest < Minitest::Test
def test_all
todo = {
description: "test action",
From 2430fcb906f27122f607bea971518a1ad19ec07c Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 11 Apr 2014 22:47:36 +0200
Subject: [PATCH 19/55] fix failing tests
not sure if the to_a fixes to get collections from activerecord is the right way
---
app/controllers/stats_controller.rb | 6 +++---
app/models/user.rb | 4 ++--
app/views/todos/add_predecessor.js.erb | 2 +-
app/views/todos/remove_predecessor.js.erb | 2 +-
test/models/todo_test.rb | 4 ++++
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb
index a2490acc..7a41d091 100644
--- a/app/controllers/stats_controller.rb
+++ b/app/controllers/stats_controller.rb
@@ -34,8 +34,8 @@ class StatsController < ApplicationController
@interpolated_actions_created_this_month = interpolate_avg_for_current_month(@actions_created_last12months_array)
@interpolated_actions_done_this_month = interpolate_avg_for_current_month(@actions_done_last12months_array)
- @created_count_array = Array.new(13, actions_last12months.created_after(@cut_off_year).count/12.0)
- @done_count_array = Array.new(13, actions_last12months.completed_after(@cut_off_year).count/12.0)
+ @created_count_array = Array.new(13, actions_last12months.created_after(@cut_off_year).count(:all)/12.0)
+ @done_count_array = Array.new(13, actions_last12months.completed_after(@cut_off_year).count(:all)/12.0)
render :layout => false
end
@@ -110,7 +110,7 @@ class StatsController < ApplicationController
@max_actions = @actions_completion_time_array.max
# get percentage done cumulative
- @cum_percent_done = convert_to_cumulative_array(@actions_completion_time_array, @actions_completion_time.count)
+ @cum_percent_done = convert_to_cumulative_array(@actions_completion_time_array, @actions_completion_time.count(:all))
render :layout => false
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 90f59d16..4fb1ca29 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -56,13 +56,13 @@ class User < ActiveRecord::Base
end
def alphabetize(scope_conditions = {})
projects = where(scope_conditions)
- projects.sort!{ |x,y| x.name.downcase <=> y.name.downcase }
+ projects.to_a.sort!{ |x,y| x.name.downcase <=> y.name.downcase }
self.update_positions(projects.map{ |p| p.id })
return projects
end
def actionize(scope_conditions = {})
todos_in_project = where(scope_conditions).includes(:todos)
- todos_in_project.sort!{ |x, y| -(x.todos.active.count <=> y.todos.active.count) }
+ todos_in_project.to_a.sort!{ |x, y| -(x.todos.active.count <=> y.todos.active.count) }
todos_in_project.reject{ |p| p.todos.active.count > 0 }
sorted_project_ids = todos_in_project.map {|p| p.id}
diff --git a/app/views/todos/add_predecessor.js.erb b/app/views/todos/add_predecessor.js.erb
index 98928bcc..82fa8cc6 100644
--- a/app/views/todos/add_predecessor.js.erb
+++ b/app/views/todos/add_predecessor.js.erb
@@ -29,7 +29,7 @@ function show_in_tickler_box() {
function regenerate_predecessor_family() {
<%
- parents = @predecessors
+ parents = @predecessors.to_a
until parents.empty?
parent = parents.pop
parents += parent.predecessors -%>
diff --git a/app/views/todos/remove_predecessor.js.erb b/app/views/todos/remove_predecessor.js.erb
index a2f49f2a..a53c505f 100644
--- a/app/views/todos/remove_predecessor.js.erb
+++ b/app/views/todos/remove_predecessor.js.erb
@@ -15,7 +15,7 @@ function replace_updated_predecessor() {
function regenerate_predecessor_family() {
<%
- parents = @predecessors
+ parents = @predecessors.to_a
until parents.empty?
parent = parents.pop
parents += parent.predecessors -%>
diff --git a/test/models/todo_test.rb b/test/models/todo_test.rb
index 100a86a6..a6ba8c92 100644
--- a/test/models/todo_test.rb
+++ b/test/models/todo_test.rb
@@ -9,6 +9,10 @@ class TodoTest < ActiveSupport::TestCase
@completed = Todo.find(8).reload
end
+ def next_week
+ 1.week.from_now.beginning_of_day.to_s(:db)
+ end
+
# Test loading a todo item
def test_load
assert_kind_of Todo, @not_completed1
From 5c636e48ad430074ee6450f44d6b25f3e3876e54 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Sat, 12 Apr 2014 21:10:19 +0200
Subject: [PATCH 20/55] remove assert which should not be used for cucumber.
---
features/step_definitions/project_steps.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb
index 43b782df..8ce96f81 100644
--- a/features/step_definitions/project_steps.rb
+++ b/features/step_definitions/project_steps.rb
@@ -73,7 +73,7 @@ Given /^I have a (completed|hidden) project called "([^"]*)"$/ do |state, projec
step "I have a project called \"#{project_name}\""
@project.send(state=="completed" ? "complete!" : "hide!")
@project.reload
- assert @project.send(state=="completed" ? "completed?" : "hidden?")
+ @project.send(state=="completed" ? "completed?" : "hidden?").should be_true
end
Given /^I have (\d+) completed projects$/ do |number_of_projects|
From 85cfa1c366795c1c5974a5013a95b7df6e61e1a7 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Sat, 12 Apr 2014 21:11:01 +0200
Subject: [PATCH 21/55] fix running minimal test framework using minitest
---
test/minimal_test_helper.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/minimal_test_helper.rb b/test/minimal_test_helper.rb
index 3a2676ca..36afb23a 100644
--- a/test/minimal_test_helper.rb
+++ b/test/minimal_test_helper.rb
@@ -1,4 +1,5 @@
ENV["RAILS_ENV"] ||= "test"
+require 'minitest/autorun'
require 'mocha/setup'
$:.unshift File.dirname(File.dirname(__FILE__))
From 49a09f36e8c82dcb24c5ebd6a5974ad80994e7a7 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Sat, 12 Apr 2014 21:21:40 +0200
Subject: [PATCH 22/55] activerecord associations do not act like a collection
anymore, so convert to array first before using map, collect, etc.
---
app/helpers/todos_helper.rb | 8 ++++----
app/views/todos/toggle_check.js.erb | 2 +-
app/views/todos/update.js.erb | 2 +-
lib/is_taggable.rb | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index 07455c80..a29147ce 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -238,7 +238,7 @@ module TodosHelper
def remote_toggle_checkbox(todo=@todo)
check_box_tag("mark_complete_#{todo.id}", toggle_check_todo_path(todo), todo.completed?, :class => 'item-checkbox',
- :title => todo.pending? ? t('todos.blocked_by', :predecessors => todo.uncompleted_predecessors.map(&:description).join(', ')) : "", :readonly => todo.pending?)
+ :title => todo.pending? ? t('todos.blocked_by', :predecessors => todo.uncompleted_predecessors.to_a.map(&:description).join(', ')) : "", :readonly => todo.pending?)
end
def remote_mobile_checkbox(todo=@todo)
@@ -251,7 +251,7 @@ module TodosHelper
if todo.completed?
content_tag(:span, {:class => :grey}) { format_date( todo.completed_at ) }
elsif todo.pending?
- title = t('todos.depends_on')+ ": " + todo.uncompleted_predecessors.map(&:description).join(', ')
+ title = t('todos.depends_on')+ ": " + todo.uncompleted_predecessors.to_a.map(&:description).join(', ')
content_tag(:a, {:title => title}) { content_tag(:span, {:class => :orange}) { t('todos.pending') } }
elsif todo.deferred?
show_date( todo.show_from )
@@ -263,7 +263,7 @@ module TodosHelper
def successors_span(todo=@todo)
unless todo.pending_successors.empty?
pending_count = todo.pending_successors.count
- title = "#{t('todos.has_x_pending', :count => pending_count)}: #{todo.pending_successors.map(&:description).join(', ')}"
+ title = "#{t('todos.has_x_pending', :count => pending_count)}: #{todo.pending_successors.to_a.map(&:description).join(', ')}"
image_tag( 'successor_off.png', :width=>'10', :height=>'16', :border=>'0', :title => title )
end
end
@@ -277,7 +277,7 @@ module TodosHelper
end
def tag_list_text(todo=@todo)
- todo.tags.join(', ')
+ todo.tags.to_a.join(', ')
end
def tag_span (tag, mobile=false)
diff --git a/app/views/todos/toggle_check.js.erb b/app/views/todos/toggle_check.js.erb
index 17567222..ef465984 100644
--- a/app/views/todos/toggle_check.js.erb
+++ b/app/views/todos/toggle_check.js.erb
@@ -159,7 +159,7 @@ function block_predecessors(next_steps) {
function regenerate_predecessor_family(next_steps) {
<%
if @predecessors
- parents = @predecessors
+ parents = @predecessors.to_a
until parents.empty?
parent = parents.pop
parents += parent.predecessors -%>
diff --git a/app/views/todos/update.js.erb b/app/views/todos/update.js.erb
index 5f7b3ce0..23187fa4 100644
--- a/app/views/todos/update.js.erb
+++ b/app/views/todos/update.js.erb
@@ -125,7 +125,7 @@ function update_predecessors(next_steps) {
function regenerate_predecessor_family() {
<%
- parents = @todo.predecessors
+ parents = @todo.predecessors.to_a
until parents.empty?
parent = parents.pop
parents += parent.predecessors
diff --git a/lib/is_taggable.rb b/lib/is_taggable.rb
index f98895f1..122f0409 100644
--- a/lib/is_taggable.rb
+++ b/lib/is_taggable.rb
@@ -9,10 +9,10 @@ module IsTaggable
has_many :taggings, :as => :taggable
has_many :tags, :through => :taggings do
def to_s
- self.map(&:name).sort.join(Tag::JOIN_DELIMITER)
+ self.to_a.map(&:name).sort.join(Tag::JOIN_DELIMITER)
end
def all_except_starred
- self.reject{|tag| tag.name == Todo::STARRED_TAG_NAME}
+ self.to_a.reject{|tag| tag.name == Todo::STARRED_TAG_NAME}
end
end
@@ -31,7 +31,7 @@ module IsTaggable
# Transactions may not be ideal for you here; be aware.
Tag.transaction do
- current = tags.map(&:name)
+ current = tags.to_a.map(&:name)
_add_tags(list - current)
_remove_tags(current - list)
end
From 098f57e0f17938a6fae02e2879970995e4112220 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Sun, 13 Apr 2014 14:24:11 +0200
Subject: [PATCH 23/55] add missing images
these were never there. used in mobile project view
---
app/assets/images/next.png | Bin 0 -> 575 bytes
app/assets/images/previous.png | Bin 0 -> 573 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 app/assets/images/next.png
create mode 100644 app/assets/images/previous.png
diff --git a/app/assets/images/next.png b/app/assets/images/next.png
new file mode 100644
index 0000000000000000000000000000000000000000..66a258d17385d2a5bbad5049a76a7d0bf5a1375c
GIT binary patch
literal 575
zcmV-F0>J%=P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA
zFaQARU;qF*m;eA5Z<1fdMgRZ-wMj%lRCwBA{PXAc&+p&<{{8*`|9=Kl@ayMyAj!tg
z3E?t=0231vGdm|2Kmf6T^!)kWweskSeb??h`^bPBhzf89+p6_sdi?v#1`t3DpFh5<
znXxvscF}?JcmLxBSMR?7DyyBb4(LFD00L=K32WYe?#_QA!2WZ$fr^0)fB<6o|NkG*
zZ4QRY|Ni}BAOsu?RUjS#2p}e)FBwP&00Bgf9v}b+AQm|5H&Xa>urUAl^A}S!JB$Gk
zKnQLBexs-W>iqT{Lnkwo1_&S|Z5ScK#mW5T>tC#n1PCC6wm*OVV@mUIGk^H_2U8p%
zfDqa~fBAydU;%!X$4@^%*!+C_5C%X1AqB~=KUlThyZ;7L3Lt=xwEg~#spsac=UBx7
z0tjEc0rlXL0tg_4ZGTb2?ArC`fB)h%5g>q&Lh=_v)uoG1khz!uAb<$?4Hp0iAQoVb
z1?Im4Cr-2f<0Yti`@VfZ#Xtr?05LH$vjo|wb+0=4=EocSdVVp!o3!zAn1cq84G=(#
zzkmPw_xESp;yp`uUm;j1L^x{pAe#yX4YQVtoDuIE)Y6b&?c>bjL
zqizfgjGH}O978H@CH?vQ{QLR$_y7I-`}hCx98_>^{usz@WIqzWygu;t4Nq
zh1Ct+%#8N(_AQJ84jmKz{C&;Oa(DNCwn*t1nT`id42&&HcscLv`6{#8B1S-=q2QSG
zCO;nr0SAuU`u~d-XJ4PcxD#w(>y7pMXDo}`^@C-#1u$$BemDL&!YbgPb3lgsOg+2b
zoV5SPy#u~}tNq;o@n}+78t10K*Kwtv&i0%C`1&WQ#ys=!Qv-Hh1!;u_iTeNlzP^8d
ze%sONY47$qZ3yTnxbo)Y$K=$fOdJYs6(^e`SspSu)HAY3FoatxlxxlsSPYD622WQ%
Jmvv4FO#s@%>9+s?
literal 0
HcmV?d00001
From 126f07a5937e9a9eabea82106b8a753d6d24ecc6 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Sun, 13 Apr 2014 14:27:19 +0200
Subject: [PATCH 24/55] try another day to get rid of test failure
I do not see the failure locally, guessing this causes the failure...
---
features/view_done.feature | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/features/view_done.feature b/features/view_done.feature
index 701fb938..efb6072a 100644
--- a/features/view_done.feature
+++ b/features/view_done.feature
@@ -156,7 +156,7 @@ Feature: Show done
@javascript @reset_time
Scenario: Activating the last todo will show empty message
Given the date is "2013-03-11"
- And I have a completed todo with description "todo 2" in context "@pc" completed 1 days ago
+ And I have a completed todo with description "todo 2" in context "@pc" completed 2 days ago
And I have a completed todo with description "todo 3" in context "@pc" completed 7 days ago
When I go to the done actions page
Then I should see "todo 1" in the done today container
From 595806be87574c91422afff06357fa7f15bb4315 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 16 May 2014 15:33:45 +0200
Subject: [PATCH 25/55] add parameter to REST api for todos to limit result to
active todos. Fixes #1388
---
app/controllers/todos_controller.rb | 5 ++++-
app/views/integrations/rest_api.html.erb | 9 +++++++++
test/integration/todo_xml_api_test.rb | 15 ++++++++++++++-
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb
index 5c8d1be3..01f27140 100644
--- a/app/controllers/todos_controller.rb
+++ b/app/controllers/todos_controller.rb
@@ -47,7 +47,10 @@ class TodosController < ApplicationController
headers['Content-Type']=Mime::TEXT.to_s
render :content_type => Mime::TEXT
end
- format.xml { render :xml => @todos.to_xml( *todo_xml_params ) }
+ format.xml do
+ @xml_todos = params[:limit_to_active_todos] ? @not_done_todos : @todos
+ render :xml => @xml_todos.to_xml( *todo_xml_params )
+ end
format.any(:rss, :atom) { @feed_title, @feed_description = 'Tracks Actions', "Actions for #{current_user.display_name}" }
format.ics
end
diff --git a/app/views/integrations/rest_api.html.erb b/app/views/integrations/rest_api.html.erb
index f52eb413..277d0eaf 100644
--- a/app/views/integrations/rest_api.html.erb
+++ b/app/views/integrations/rest_api.html.erb
@@ -79,6 +79,15 @@ field to ID, created_at, modified_at, completed_at by adding the pa
+If you only want to get the active todos, you add the parameter limit_to_active_todos and set it to some value like this:
+
+
The API provides mechanisms for adding, updating and deleting resources using the HTTP methods PUT, POST and DELETE in combination with the content.
diff --git a/test/integration/todo_xml_api_test.rb b/test/integration/todo_xml_api_test.rb
index 8234c056..ed2458ee 100644
--- a/test/integration/todo_xml_api_test.rb
+++ b/test/integration/todo_xml_api_test.rb
@@ -17,7 +17,7 @@ class TodoXmlApiTest < ActionDispatch::IntegrationTest
get '/tickler.xml', {}, {}
assert_response 401
- get "/tickler.xml", {}, {'HTT_AUTHORIZATION' => "Basic " + Base64.encode64("wrong:wrong"),'ACCEPT' => 'application/xml'}
+ get "/tickler.xml", {}, {'HTTP_AUTHORIZATION' => "Basic " + Base64.encode64("wrong:wrong"),'ACCEPT' => 'application/xml'}
assert_response 401
end
@@ -32,6 +32,19 @@ class TodoXmlApiTest < ActionDispatch::IntegrationTest
assert_no_tag :tag => "user_id"
end
+ def test_get_index_with_only_active_todos
+ authenticated_get_xml "/todos.xml", @user.login, @password, {}
+ assert_response 200
+
+ all_todo_count = assigns['xml_todos']
+
+ authenticated_get_xml "/todos.xml?limit_to_active_todos=1", @user.login, @password, {}
+ assert_response 200
+
+ active_todo_count = assigns['xml_todos']
+ assert all_todo_count != active_todo_count, "active should be less than all todos"
+ end
+
def test_create_todo_with_show_from
old_count = @user.todos.count
authenticated_post_xml_to_todo_create "
From 0f5a11882ec9b7279f229dde3789e105be7c7984 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 16 May 2014 16:14:50 +0200
Subject: [PATCH 26/55] fix deleting dependencies
---
app/assets/javascripts/tracks.js | 4 ++--
app/models/todo.rb | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/assets/javascripts/tracks.js b/app/assets/javascripts/tracks.js
index 91301cc9..908eb6d5 100644
--- a/app/assets/javascripts/tracks.js
+++ b/app/assets/javascripts/tracks.js
@@ -588,7 +588,7 @@ var TodoItems = {
$(document).on("click",'.item-container a.delete_dependency_button', function(evt){
var predecessor_id=$(this).attr("x_predecessors_id");
var ajax_options = default_ajax_options_for_scripts('DELETE', this.href, $(this).parents('.item-container'));
- ajax_options.data << {predecessor: predecessor_id}
+ ajax_options.data["predecessor"] = predecessor_id
$.ajax(ajax_options);
return false;
});
@@ -1245,7 +1245,7 @@ function setup_periodic_check(url_for_check, interval_in_sec, method) {
function(){
var settings = default_ajax_options_for_scripts( method ? method : "GET", url_for_check, null);
if(typeof(AUTH_TOKEN) != 'undefined'){
- settings.data << {authenticity_token: AUTH_TOKEN}
+ settings.data["authenticity_token"] = AUTH_TOKEN
}
$.ajax(settings);
},
diff --git a/app/models/todo.rb b/app/models/todo.rb
index afb453e6..d91d8ee1 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -207,6 +207,7 @@ class Todo < ActiveRecord::Base
def remove_predecessor(predecessor)
self.predecessors.delete(predecessor)
if self.predecessors.empty?
+ self.reload # reload predecessors
self.not_part_of_hidden_container? ? self.activate! : self.hide!
else
save!
From ede9636c6d1430f1e7bad8cc06a51d8ca83c4975 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 16 May 2014 10:19:27 -0400
Subject: [PATCH 27/55] Pin Rails to 4.1.x, not 4.x
---
Gemfile | 2 +-
Gemfile.lock | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Gemfile b/Gemfile
index 8d87f436..4b012496 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
-gem 'rails', '~>4.1'
+gem 'rails', '~>4.1.0'
gem 'sass-rails', '~>4.0'
gem 'coffee-rails', '~>4.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 98c3355b..1e6e36f6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -228,7 +228,7 @@ DEPENDENCIES
mocha
mysql2
rack-mini-profiler
- rails (~> 4.1)
+ rails (~> 4.1.0)
rails_autolink
rspec-expectations
sanitize
From 8194ab9d7f0a08e3bd34afdd810f6ae1f6685e86 Mon Sep 17 00:00:00 2001
From: Reinier Balt
Date: Fri, 16 May 2014 16:35:05 +0200
Subject: [PATCH 28/55] fix #1432.
---
app/helpers/todos_helper.rb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index a29147ce..bdf7118e 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -508,7 +508,13 @@ module TodosHelper
end
def todo_moved_out_of_container
- return (@project_changed && @group_view_by=='project') || (@context_changed && @group_view_by=='context')
+ return
+ # moved from one project container to another
+ (@project_changed && @group_view_by=='project') ||
+ # moved from one context container to another
+ (@context_changed && @group_view_by=='context') ||
+ # moved from actions-without-project container to another
+ (@context_changed && @group_view_by=='project' && @todo.project_id.nil?)
end
def update_needs_to_hide_container
From 7d7e47deffe6e0c628ccaa6f910750fab8040370 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 16 May 2014 11:02:08 -0400
Subject: [PATCH 29/55] Add Spring and spring-aware binstubs
Also remove /script, which is no longer used in Rails 4
---
.gitignore | 1 -
.travis.yml | 2 +-
Gemfile | 2 ++
Gemfile.lock | 5 +++++
app/views/integrations/index.de.html.erb | 4 ++--
app/views/integrations/index.en.html.erb | 4 ++--
app/views/integrations/index.nl.html.erb | 4 ++--
bin/cucumber | 7 +++++++
{script => bin}/rails | 4 ++++
bin/rake | 7 +++++++
bin/spring | 18 ++++++++++++++++++
doc/CHANGELOG | 2 ++
doc/installation.textile | 8 ++++----
doc/upgrading.textile | 6 +++---
script/cucumber | 10 ----------
15 files changed, 59 insertions(+), 25 deletions(-)
create mode 100755 bin/cucumber
rename {script => bin}/rails (79%)
create mode 100755 bin/rake
create mode 100755 bin/spring
delete mode 100755 script/cucumber
diff --git a/.gitignore b/.gitignore
index b418ad46..0dc4677e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,6 @@
/.bundle
/.emacs-project
/.redcar
-/bin
/coverage
/db/*.db
/db/*.sqlite3
diff --git a/.travis.yml b/.travis.yml
index 5eeee3cb..91bfd9e8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,7 @@ before_install:
- "cp config/site.yml.tmpl config/site.yml"
- "cp config/database.yml.tmpl config/database.yml"
-script: "CODECLIMATE_REPO_TOKEN=5c52fdd2bbcd0734d56ddb2c3cbaac782da345273e8689d25f54a065ccc3397c bundle exec rake ci RACK_ENV=test"
+script: "CODECLIMATE_REPO_TOKEN=5c52fdd2bbcd0734d56ddb2c3cbaac782da345273e8689d25f54a065ccc3397c bin/rake ci RACK_ENV=test"
notifications:
email: false
diff --git a/Gemfile b/Gemfile
index 4b012496..40da7701 100644
--- a/Gemfile
+++ b/Gemfile
@@ -42,6 +42,8 @@ gem 'bcrypt-ruby', '~> 3.0.0'
# gem 'jbuilder', '~> 1.2'
group :development do
+ gem "spring"
+ gem "spring-commands-cucumber"
gem "yard"
gem 'tolk', '>=1.5.0'
gem "bullet"
diff --git a/Gemfile.lock b/Gemfile.lock
index 1e6e36f6..545561ec 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -167,6 +167,9 @@ GEM
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
+ spring (1.1.3)
+ spring-commands-cucumber (1.0.1)
+ spring (>= 0.9.1)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -235,6 +238,8 @@ DEPENDENCIES
sass-rails (~> 4.0)
selenium-webdriver
simplecov
+ spring
+ spring-commands-cucumber
sqlite3
swf_fu
therubyracer
diff --git a/app/views/integrations/index.de.html.erb b/app/views/integrations/index.de.html.erb
index efaa2136..70bc29d2 100644
--- a/app/views/integrations/index.de.html.erb
+++ b/app/views/integrations/index.de.html.erb
@@ -105,7 +105,7 @@
"<%= Preference.human_attribute_name('sms_context') %>" for todos sent in
via email (which could come from an SMS message)
In sendmail/qmail/postfix/whatever, set up an email address
- alias to pipe messages to
/usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
+ alias to pipe messages to
/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
Send an email to your newly configured address!
You can also use the Rich Todo API to send in tasks like "do laundry @ Home"
@@ -116,7 +116,7 @@
You may need to configure your site.yml to tell the message gateway to look at the to: field or from: field to
lookup Tracks' user from the email address in that field.
You can also send all email to a specific Tracks user. Configure mail_dispatch in site.yml to single_user and pass the login of the user:
-
TRACKS_MAIL_RECEIVER=<%=current_user.login%> usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
+
TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
diff --git a/app/views/integrations/index.en.html.erb b/app/views/integrations/index.en.html.erb
index 0dc900a2..55bafc63 100644
--- a/app/views/integrations/index.en.html.erb
+++ b/app/views/integrations/index.en.html.erb
@@ -107,7 +107,7 @@
"<%= Preference.human_attribute_name('sms_context') %>" for todos sent in
via email (which could come from an SMS message)
In sendmail/qmail/postfix/whatever, set up an email address
- alias to pipe messages to
/usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
+ alias to pipe messages to
/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
Send an email to your newly configured address!
You can also use the Rich Todo API to send in tasks like "do laundry @ Home"
@@ -118,7 +118,7 @@
You may need to configure your site.yml to tell the message gateway to look at the to: field or from: field to
lookup Tracks' user from the email address in that field.
You can also send all email to a specific Tracks user. Configure mail_dispatch in site.yml to single_user and pass the login of the user:
-
TRACKS_MAIL_RECEIVER=<%=current_user.login%> usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
+
TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
diff --git a/app/views/integrations/index.nl.html.erb b/app/views/integrations/index.nl.html.erb
index aaf6abcb..666f78f9 100644
--- a/app/views/integrations/index.nl.html.erb
+++ b/app/views/integrations/index.nl.html.erb
@@ -109,7 +109,7 @@
verzonden zijn via email (die bijv. komen via een SMS message)
In sendmail/qmail/postfix/whatever, stel een email address
alias in om berichten door te sturen naar
-
/usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
+
/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
Verstuur een email naar het net geconfigureerde e-mail adres!
Je kan ook de Rich Todo API gebruiken om acties te maken zoals "do laundry @ Home"
@@ -120,7 +120,7 @@
Het kan nodig zijn om jouw site.yml te configureren om de message gateway te laten kijken naar het to: veld of het from: veld om
de Tracks-gebruiker op te zoeken met het emailadres uit dat veld.
Je kan ook alle email naar een specifieke Tracks gebruiker sturen. Stel mail_dispatch in site.yml in op single_user en geeft de login van de gebruiker door:
-
TRACKS_MAIL_RECEIVER=<%=current_user.login%> usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
+
TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
diff --git a/bin/cucumber b/bin/cucumber
new file mode 100755
index 00000000..12971cdc
--- /dev/null
+++ b/bin/cucumber
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
+require 'bundler/setup'
+load Gem.bin_path('cucumber', 'cucumber')
diff --git a/script/rails b/bin/rails
similarity index 79%
rename from script/rails
rename to bin/rails
index f8da2cff..1c894d52 100755
--- a/script/rails
+++ b/bin/rails
@@ -1,4 +1,8 @@
#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 00000000..0fb4e07e
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
+require 'bundler/setup'
+load Gem.bin_path('rake', 'rake')
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 00000000..253ec37c
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+# This file loads spring without using Bundler, in order to be fast
+# It gets overwritten when you run the `spring binstub` command
+
+unless defined?(Spring)
+ require "rubygems"
+ require "bundler"
+
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
+ ENV["GEM_HOME"] = ""
+ Gem.paths = ENV
+
+ gem "spring", match[1]
+ require "spring/binstub"
+ end
+end
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index 7aebb556..eaa8ba23 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -16,6 +16,8 @@
== Version 2.3devel
New and changed features
+* Added new binstubs. The commands `bin/rails` and `bin/rake` take the place of
+ the old `bundle exec rails` and `bundle exec rake`, respectively.
* You can select to group todos on the home page by context or by
project (using the view menu). This also works for tag page, the project page,
the tickler and the context page
diff --git a/doc/installation.textile b/doc/installation.textile
index 5ac6628d..a0e1f60f 100644
--- a/doc/installation.textile
+++ b/doc/installation.textile
@@ -60,7 +60,7 @@ h2. Configure variables
# In the @config@ folder, copy the files @database.yml.tmpl@ and @site.yml.tmpl@ to @database.yml@ and @site.yml@, respectively.
# Open the file @config/database.yml@ and edit the @production:@ section with the details of your database. If you are using MySQL the @adapter:@ line should read @adapter: mysql2@, @host: localhost@ (in the majority of cases), and your username and password should match those you assigned when you created the database. If you are using SQLite3, you should have only two lines under the production section: @adapter: sqlite3@ and @database: db/tracks.db@.
-# Open the file @config/site.yml@, and read through the settings to make sure that they suit your setup. In most cases, all you need to change are the @salt: "change-me"@ line (change the string "change-me" to some other string of your choice), the administrator email address (@admin_email@), and the time zone setting. For the time zone setting you can use the command @bundle exec rake time:zones:local@ to see all available timezones on your machine
+# Open the file @config/site.yml@, and read through the settings to make sure that they suit your setup. In most cases, all you need to change are the @salt: "change-me"@ line (change the string "change-me" to some other string of your choice), the administrator email address (@admin_email@), and the time zone setting. For the time zone setting you can use the command @bin/rake time:zones:local@ to see all available timezones on your machine
# If you are using Windows, you may need to check the 'shebang' lines (@#!/usr/bin/env ruby@) of the @/public/dispatch.*@ files and all the files in the @/script@ directory. They are set to @#!/usr/bin/env ruby@ by default. This should work for all Unix based setups (Linux or Mac OS X), but Windows users will probably have to change it to something like @#c:/ruby/bin/ruby@ to point to the Ruby binary on your system.
# If you intend to deploy Tracks with the built in webserver called WEBrick, you'll need to change @config.serve_static_assets@ to @true@ in @config/environments/production.rb@ in order for the images, stylesheets, and javascript files to be served correctly.
@@ -69,7 +69,7 @@ h2. Populate your database with the Tracks schema
Open a terminal and change into the root of your Tracks directory. Enter the following command:
-bc. bundle exec rake db:migrate RAILS_ENV=production
+bc. bin/rake db:migrate RAILS_ENV=production
This will set up your database with the required structure to hold Tracks' data.
@@ -78,14 +78,14 @@ h2. Precompile assets
Static assets (images, stylesheets, and javascript) need to be compiled in order for them to work correctly with the new asset pipeline feature in Rails. Precompiling your assets is as simple as running the following command while inside the Tracks root directory:
-bc. bundle exec rake assets:precompile
+bc. bin/rake assets:precompile
h2. Start the server
While still in the Terminal inside the Tracks root directory, issue the following command:
-bc. bundle exec rails server -e production
+bc. bin/rails server -e production
If all goes well, you should see some text informing you that the WEBrick server is running: @=> Rails application starting in production on http://0.0.0.0:3000@. If you are already running other services on port 3000, you need to select a different port when running the server, using the @-p@ option.
diff --git a/doc/upgrading.textile b/doc/upgrading.textile
index ba19f75d..2c71375e 100644
--- a/doc/upgrading.textile
+++ b/doc/upgrading.textile
@@ -9,9 +9,9 @@ That said. To upgrade:
# Install Tracks 2.3devel in a new directory. Or you can create a separate installation of 2.3 for testing purposes.
# Copy over the configuration from your previous Tracks installation. If using SQLite3, copy the old database into the new Tracks 2.3devel directory.
# Check that you have all dependencies installed: @bundle install --without development test@ Or leave out the @--without development test@ part if you intent to test or develop on this tree.
-# Run @bundle exec rake db:migrate RAILS_ENV=production@ to update your old database to the new schema. This is the point of no return. Make sure you have backups!
-# Precompile your static assets (css, javascript, etc.) by running @bundle exec rake assets:precompile@.
-# Run @bundle exec rails server -e production@ inside your Tracks 2.3devel directory to start up Tracks. Or use @-e development@ if you intent to try your changes and get more log info.
+# Run @bin/rake db:migrate RAILS_ENV=production@ to update your old database to the new schema. This is the point of no return. Make sure you have backups!
+# Precompile your static assets (css, javascript, etc.) by running @bin/rake assets:precompile@.
+# Run @bin/rails server -e production@ inside your Tracks 2.3devel directory to start up Tracks. Or use @-e development@ if you intent to try your changes and get more log info.
Please note that if you intend to use Tracks with the built in webserver called WEBrick for production, you'll need to change @config.serve_static_assets@ to @true@ in @config/environments/production.rb@ in order for the images, stylesheets, and javascript files to be served correctly.
diff --git a/script/cucumber b/script/cucumber
deleted file mode 100755
index 7fa5c920..00000000
--- a/script/cucumber
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-
-vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
-if vendored_cucumber_bin
- load File.expand_path(vendored_cucumber_bin)
-else
- require 'rubygems' unless ENV['NO_RUBYGEMS']
- require 'cucumber'
- load Cucumber::BINARY
-end
From d0cec167a81787c41b8c5d83b4e939005ad082f8 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 16 May 2014 13:24:40 -0400
Subject: [PATCH 30/55] Replace Timecop with new ActiveSupport helpers
---
Gemfile | 1 -
Gemfile.lock | 2 --
features/step_definitions/generic_steps.rb | 2 +-
features/support/hooks.rb | 2 +-
test/controllers/recurring_todos_controller_test.rb | 4 ++--
test/controllers/stats_controller_test.rb | 4 ++--
test/controllers/todos_controller_test.rb | 4 ++--
.../recurring_todos/abstract_repeat_pattern_test.rb | 2 +-
test/models/staleness_test.rb | 7 ++++---
test/models/todo_test.rb | 2 +-
test/models/todos/calendar_test.rb | 4 ++--
test/models/todos/done_todos_test.rb | 10 +++++-----
test/models/user_test.rb | 7 +++----
13 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/Gemfile b/Gemfile
index 40da7701..ab4154dd 100644
--- a/Gemfile
+++ b/Gemfile
@@ -59,7 +59,6 @@ group :test do
gem "mocha", :require => false
gem "aruba", git: 'https://github.com/cucumber/aruba', :require => false # need 0.5.4 for piping files; 0.5.3 is latest
- gem "timecop", "~> 0.6.2"
# Note that > 2.14 has problems, see:
# https://code.google.com/p/selenium/issues/detail?id=3075
diff --git a/Gemfile.lock b/Gemfile.lock
index 545561ec..28505feb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -189,7 +189,6 @@ GEM
thor (0.19.1)
thread_safe (0.3.3)
tilt (1.4.1)
- timecop (0.6.3)
tolk (1.5.0)
safe_yaml (~> 0.8)
will_paginate
@@ -243,7 +242,6 @@ DEPENDENCIES
sqlite3
swf_fu
therubyracer
- timecop (~> 0.6.2)
tolk (>= 1.5.0)
uglifier (>= 1.3.0)
will_paginate
diff --git a/features/step_definitions/generic_steps.rb b/features/step_definitions/generic_steps.rb
index 98d4f13f..b48c2ccb 100644
--- a/features/step_definitions/generic_steps.rb
+++ b/features/step_definitions/generic_steps.rb
@@ -12,7 +12,7 @@ end
Given /^the date is "(.*?)"$/ do |date|
# remember to tag the scenario with @reset_time to reset this travel
- Timecop.travel(date)
+ travel_to date
end
Given(/^I have selected the view for group by (project|context)$/) do |grouping|
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index db04f79e..2895076c 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -9,5 +9,5 @@ Before('@aruba') do
end
After('@reset_time') do
- Timecop.return
+ travel_back
end
\ No newline at end of file
diff --git a/test/controllers/recurring_todos_controller_test.rb b/test/controllers/recurring_todos_controller_test.rb
index b8ce950e..9f55e55a 100644
--- a/test/controllers/recurring_todos_controller_test.rb
+++ b/test/controllers/recurring_todos_controller_test.rb
@@ -183,7 +183,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
# this test is a duplicate of the unit test. Only this test covers the
# codepath in the controllers
- Timecop.travel(Time.local(2012,1,1)) do
+ travel_to Time.local(2012,1,1) do
login_as(:admin_user)
@@ -292,7 +292,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
end
def test_start_on_monthly_rec_todo
- Timecop.travel(Time.local(2012,1,1)) do
+ travel_to Time.local(2012,1,1) do
login_as(:admin_user)
diff --git a/test/controllers/stats_controller_test.rb b/test/controllers/stats_controller_test.rb
index 20add95c..5f121da9 100644
--- a/test/controllers/stats_controller_test.rb
+++ b/test/controllers/stats_controller_test.rb
@@ -97,7 +97,7 @@ class StatsControllerTest < ActionController::TestCase
end
def test_actions_done_last12months_data
- Timecop.travel(Time.local(2013, 1, 15)) do
+ travel_to Time.local(2013, 1, 15) do
login_as(:admin_user)
@current_user = User.find(users(:admin_user).id)
@current_user.todos.delete_all
@@ -143,7 +143,7 @@ class StatsControllerTest < ActionController::TestCase
end
def test_empty_last12months_data
- Timecop.travel(Time.local(2013, 1, 15)) do
+ travel_to Time.local(2013, 1, 15) do
login_as(:admin_user)
@current_user = User.find(users(:admin_user).id)
@current_user.todos.delete_all
diff --git a/test/controllers/todos_controller_test.rb b/test/controllers/todos_controller_test.rb
index 8540d450..b55730bf 100644
--- a/test/controllers/todos_controller_test.rb
+++ b/test/controllers/todos_controller_test.rb
@@ -435,7 +435,7 @@ class TodosControllerTest < ActionController::TestCase
login_as(:admin_user)
# given a todo in the tickler that should be activated
- Timecop.travel(2.weeks.ago) do
+ travel_to 2.weeks.ago do
create_todo(
description: "tickler",
show_from: 1.week.from_now.
@@ -715,7 +715,7 @@ class TodosControllerTest < ActionController::TestCase
end
def test_toggle_check_on_rec_todo_show_from_today
- Timecop.travel(2014, 1, 15) do
+ travel_to Time.zone.local(2014, 1, 15) do
login_as(:admin_user)
# link todo_1 and recurring_todo_1
diff --git a/test/models/recurring_todos/abstract_repeat_pattern_test.rb b/test/models/recurring_todos/abstract_repeat_pattern_test.rb
index d0bcf98b..339c1dac 100644
--- a/test/models/recurring_todos/abstract_repeat_pattern_test.rb
+++ b/test/models/recurring_todos/abstract_repeat_pattern_test.rb
@@ -101,7 +101,7 @@ module RecurringTodos
end
def test_determine_start
- Timecop.travel(2013,1,1) do
+ travel_to Time.zone.local(2013,1,1) do
rt = create_recurring_todo
assert_equal "2013-01-01 00:00:00", rt.send(:determine_start, nil).to_s(:db), "no previous date, use today"
assert_equal "2013-01-01 00:00:00", rt.send(:determine_start, nil, 1.day).to_s(:db), "no previous date, use today without offset"
diff --git a/test/models/staleness_test.rb b/test/models/staleness_test.rb
index 976a8861..ddbff98e 100644
--- a/test/models/staleness_test.rb
+++ b/test/models/staleness_test.rb
@@ -1,9 +1,10 @@
require_relative '../minimal_test_helper'
require_relative '../../lib/staleness'
require_relative '../../lib/user_time'
-require 'timecop'
class StalenessTest < Minitest::Test
+ include ActiveSupport::Testing::TimeHelpers
+
FakePrefs = Struct.new(:time_zone)
FakeUser = Struct.new(:time) do
def prefs
@@ -36,11 +37,11 @@ class StalenessTest < Minitest::Test
def setup
@current_user = FakeUser.new(now)
- Timecop.freeze(Time.utc(2013,02,28))
+ travel_to Time.utc(2013,02,28)
end
def teardown
- Timecop.return
+ travel_back
end
def test_item_with_due_date_is_not_stale_ever
diff --git a/test/models/todo_test.rb b/test/models/todo_test.rb
index a6ba8c92..3786b417 100644
--- a/test/models/todo_test.rb
+++ b/test/models/todo_test.rb
@@ -169,7 +169,7 @@ class TodoTest < ActiveSupport::TestCase
dates.each do |show_from_date|
# setup test case
t = @not_completed1
- Timecop.travel(show_from_date - 1.day) do
+ travel_to show_from_date - 1.day do
t.show_from = show_from_date
t.save!
assert t.deferred?
diff --git a/test/models/todos/calendar_test.rb b/test/models/todos/calendar_test.rb
index 5148f47c..31442a19 100644
--- a/test/models/todos/calendar_test.rb
+++ b/test/models/todos/calendar_test.rb
@@ -34,7 +34,7 @@ module Todos
def test_due_this_month_at_start_month
# should return 1 todo
- Timecop.travel(2013,9,1) do
+ travel_to Time.zone.local(2013,9,1) do
due_this_month = create_todo(Time.zone.now.end_of_month)
assert_equal [due_this_month], @calendar.due_this_month
end
@@ -43,7 +43,7 @@ module Todos
def test_due_this_month_at_end_month
# the todo is due next week and is thus left out for todos due rest
# of month (i.e. after next week, but in this month)
- Timecop.travel(2013,9,23) do
+ travel_to Time.zone.local(2013,9,23) do
due_this_month = create_todo(Time.zone.now.end_of_month)
assert_equal 0, @calendar.due_this_month.size
end
diff --git a/test/models/todos/done_todos_test.rb b/test/models/todos/done_todos_test.rb
index b3b066e4..17a7dcfd 100644
--- a/test/models/todos/done_todos_test.rb
+++ b/test/models/todos/done_todos_test.rb
@@ -4,7 +4,7 @@ module Todos
class DoneTodosTest < ActiveSupport::TestCase
def test_completed_period
- Timecop.travel(2013,1,23,12,00,00) do # wednesday at 12:00;
+ travel_to Time.zone.local(2013,1,23,12,00,00) do # wednesday at 12:00;
assert_equal "today", DoneTodos.completed_period(Time.zone.local(2013,1,23,9,00)) # today at 9:00
assert_equal "rest_of_week", DoneTodos.completed_period(Time.zone.local(2013,1,21)) # monday this week
assert_equal "rest_of_month", DoneTodos.completed_period(Time.zone.local(2013,1,8)) # tuestday in first week of jan
@@ -30,13 +30,13 @@ module Todos
todos = users(:admin_user).todos
# When I mark a todo complete on jan 1
- Timecop.travel(2013,1,1,0,0) do
+ travel_to Time.zone.local(2013,1,1,0,0) do
t = users(:admin_user).todos.active.first
t.complete!
end
# Then I should be in rest_of_week on jan 2
- Timecop.travel(2013,1,2,0,0) do
+ travel_to Time.zone.local(2013,1,2,0,0) do
assert 0, DoneTodos.done_today(todos.reload, {}).count
assert 1, DoneTodos.done_rest_of_week(todos.reload, {}).count
end
@@ -46,13 +46,13 @@ module Todos
todos = users(:admin_user).todos
# When I mark a todo complete on jan 1
- Timecop.travel(2013,1,1,0,0) do
+ travel_to Time.zone.local(2013,1,1,0,0) do
t = users(:admin_user).todos.active.first
t.complete!
end
# Then I should be in rest_of_month on jan 21
- Timecop.travel(2013,1,21,0,0) do
+ travel_to Time.zone.local(2013,1,21,0,0) do
assert 0, DoneTodos.done_today(todos.reload, {}).count
assert 0, DoneTodos.done_rest_of_week(todos.reload, {}).count
assert 1, DoneTodos.done_rest_of_month(todos.reload, {}).count
diff --git a/test/models/user_test.rb b/test/models/user_test.rb
index e308f84e..7929b8a8 100644
--- a/test/models/user_test.rb
+++ b/test/models/user_test.rb
@@ -1,5 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
-require 'timecop'
class UserTest < ActiveSupport::TestCase
fixtures :users, :preferences, :projects, :contexts, :todos, :recurring_todos
@@ -351,7 +350,7 @@ class UserTest < ActiveSupport::TestCase
assert_nil u.remember_token_expires_at
# set token on 2013-feb-28
- Timecop.travel(Time.local(2013, 2, 28)) do
+ travel_to Time.local(2013, 2, 28) do
u.remember_me
assert_not_nil u.remember_token_expires_at
@@ -359,12 +358,12 @@ class UserTest < ActiveSupport::TestCase
end
# token should be valid after 5 days
- Timecop.travel(Time.local(2013, 3, 5)) do
+ travel_to Time.local(2013, 3, 5) do
assert u.remember_token?
end
# token should not be valid after more than 2 weeks
- Timecop.travel(Time.local(2013, 3, 28)) do
+ travel_to Time.local(2013, 3, 28) do
assert !u.remember_token?
end
end
From 2386e67dec6c862a3ba531eebc218e2da1f64831 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 16 May 2014 18:03:13 -0400
Subject: [PATCH 31/55] Simplify requiring of test helpers
---
test/controllers/calendar_controller_test.rb | 2 +-
test/controllers/context_actions_data_test.rb | 2 +-
test/controllers/contexts_controller_test.rb | 2 +-
test/controllers/data_controller_test.rb | 2 +-
test/controllers/feedlist_controller_test.rb | 2 +-
test/controllers/integrations_controller_test.rb | 2 +-
test/controllers/login_controller_test.rb | 2 +-
test/controllers/mailgun_controller_test.rb | 2 +-
test/controllers/message_gateway_test.rb | 2 +-
test/controllers/notes_controller_test.rb | 2 +-
test/controllers/preferences_controller_test.rb | 2 +-
test/controllers/projects_controller_test.rb | 2 +-
test/controllers/recurring_todos_controller_test.rb | 2 +-
test/controllers/search_controller_test.rb | 2 +-
test/controllers/stats_controller_test.rb | 2 +-
test/controllers/todos_controller_test.rb | 2 +-
test/controllers/users_controller_test.rb | 2 +-
test/integration/context_xml_api_test.rb | 2 +-
test/integration/feed_smoke_test.rb | 2 +-
test/integration/project_xml_api_test.rb | 2 +-
test/integration/recurring_todos_test.rb | 2 +-
test/integration/stories_test.rb | 2 +-
test/integration/todo_xml_api_test.rb | 2 +-
test/integration/users_xml_api_test.rb | 2 +-
test/models/attribute_handler_test.rb | 2 +-
test/models/context_test.rb | 2 +-
test/models/is_taggable_test.rb | 2 +-
test/models/notes_test.rb | 2 +-
test/models/pie_chart_data_test.rb | 2 +-
test/models/preference_test.rb | 2 +-
test/models/project_from_todo_test.rb | 2 +-
test/models/project_test.rb | 2 +-
test/models/recurring_todo_test.rb | 2 +-
.../recurring_todos/abstract_recurring_todos_builder_test.rb | 2 +-
test/models/recurring_todos/abstract_repeat_pattern_test.rb | 2 +-
.../recurring_todos/daily_recurring_todos_builder_test.rb | 2 +-
test/models/recurring_todos/daily_repeat_pattern_test.rb | 2 +-
test/models/recurring_todos/form_helper_test.rb | 2 +-
.../recurring_todos/monthly_recurring_todos_builder_test.rb | 2 +-
test/models/recurring_todos/monthly_repeat_pattern_test.rb | 2 +-
test/models/recurring_todos/recurring_todos_builder_test.rb | 2 +-
.../recurring_todos/weekly_recurring_todos_builder_test.rb | 2 +-
test/models/recurring_todos/weekly_repeat_pattern_test.rb | 2 +-
.../recurring_todos/yearly_recurring_todos_builder_test.rb | 2 +-
test/models/recurring_todos/yearly_repeat_pattern_test.rb | 2 +-
test/models/staleness_test.rb | 2 +-
test/models/tag_cloud_query_test.rb | 2 +-
test/models/tag_cloud_test.rb | 2 +-
test/models/tag_test.rb | 2 +-
test/models/tagging_test.rb | 2 +-
test/models/time_to_complete_test.rb | 2 +-
test/models/todo_create_params_helper_test.rb | 2 +-
test/models/todo_from_rich_message_test.rb | 2 +-
test/models/todo_test.rb | 2 +-
test/models/todos/calendar_test.rb | 2 +-
test/models/todos/done_todos_test.rb | 2 +-
test/models/tracks_cli/tracks_api_test.rb | 2 +-
test/models/tracks_cli/tracks_xml_builder_test.rb | 2 +-
test/models/user_test.rb | 2 +-
59 files changed, 59 insertions(+), 59 deletions(-)
diff --git a/test/controllers/calendar_controller_test.rb b/test/controllers/calendar_controller_test.rb
index d4f47eaa..a2ce72a3 100644
--- a/test/controllers/calendar_controller_test.rb
+++ b/test/controllers/calendar_controller_test.rb
@@ -1,4 +1,4 @@
-require_relative '../test_helper'
+require 'test_helper'
class CalendarControllerTest < ActionController::TestCase
diff --git a/test/controllers/context_actions_data_test.rb b/test/controllers/context_actions_data_test.rb
index 7bce3991..0bcaae6a 100644
--- a/test/controllers/context_actions_data_test.rb
+++ b/test/controllers/context_actions_data_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ContextActionsDataTest < ActionController::TestCase
tests StatsController
diff --git a/test/controllers/contexts_controller_test.rb b/test/controllers/contexts_controller_test.rb
index d1295e18..56492154 100644
--- a/test/controllers/contexts_controller_test.rb
+++ b/test/controllers/contexts_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ContextsControllerTest < ActionController::TestCase
fixtures :users, :preferences, :contexts
diff --git a/test/controllers/data_controller_test.rb b/test/controllers/data_controller_test.rb
index e78c75e8..4f003fae 100644
--- a/test/controllers/data_controller_test.rb
+++ b/test/controllers/data_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class DataControllerTest < ActionController::TestCase
diff --git a/test/controllers/feedlist_controller_test.rb b/test/controllers/feedlist_controller_test.rb
index 1122be5f..a14a9415 100644
--- a/test/controllers/feedlist_controller_test.rb
+++ b/test/controllers/feedlist_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class FeedlistControllerTest < ActionController::TestCase
diff --git a/test/controllers/integrations_controller_test.rb b/test/controllers/integrations_controller_test.rb
index ba382a21..6e15235c 100644
--- a/test/controllers/integrations_controller_test.rb
+++ b/test/controllers/integrations_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class IntegrationsControllerTest < ActionController::TestCase
diff --git a/test/controllers/login_controller_test.rb b/test/controllers/login_controller_test.rb
index 3e8892d8..84fe70a0 100644
--- a/test/controllers/login_controller_test.rb
+++ b/test/controllers/login_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class LoginControllerTest < ActionController::TestCase
fixtures :preferences, :users
diff --git a/test/controllers/mailgun_controller_test.rb b/test/controllers/mailgun_controller_test.rb
index b151afc9..876cc9bd 100644
--- a/test/controllers/mailgun_controller_test.rb
+++ b/test/controllers/mailgun_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class MailgunControllerTest < ActionController::TestCase
diff --git a/test/controllers/message_gateway_test.rb b/test/controllers/message_gateway_test.rb
index ea84127d..d64f6adc 100644
--- a/test/controllers/message_gateway_test.rb
+++ b/test/controllers/message_gateway_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class MessageGatewayTest < ActiveSupport::TestCase
diff --git a/test/controllers/notes_controller_test.rb b/test/controllers/notes_controller_test.rb
index a83dabf1..9c14d236 100644
--- a/test/controllers/notes_controller_test.rb
+++ b/test/controllers/notes_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class NotesControllerTest < ActionController::TestCase
diff --git a/test/controllers/preferences_controller_test.rb b/test/controllers/preferences_controller_test.rb
index 9d55e83e..f87eb1a0 100644
--- a/test/controllers/preferences_controller_test.rb
+++ b/test/controllers/preferences_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class PreferencesControllerTest < ActionController::TestCase
diff --git a/test/controllers/projects_controller_test.rb b/test/controllers/projects_controller_test.rb
index 1b2b557f..da4e196f 100644
--- a/test/controllers/projects_controller_test.rb
+++ b/test/controllers/projects_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ProjectsControllerTest < ActionController::TestCase
diff --git a/test/controllers/recurring_todos_controller_test.rb b/test/controllers/recurring_todos_controller_test.rb
index 9f55e55a..e58fe562 100644
--- a/test/controllers/recurring_todos_controller_test.rb
+++ b/test/controllers/recurring_todos_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class RecurringTodosControllerTest < ActionController::TestCase
diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb
index 7d99c59d..0c7fda30 100644
--- a/test/controllers/search_controller_test.rb
+++ b/test/controllers/search_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class SearchControllerTest < ActionController::TestCase
diff --git a/test/controllers/stats_controller_test.rb b/test/controllers/stats_controller_test.rb
index 5f121da9..2c7e3485 100644
--- a/test/controllers/stats_controller_test.rb
+++ b/test/controllers/stats_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class StatsControllerTest < ActionController::TestCase
diff --git a/test/controllers/todos_controller_test.rb b/test/controllers/todos_controller_test.rb
index b55730bf..fbf8223f 100644
--- a/test/controllers/todos_controller_test.rb
+++ b/test/controllers/todos_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TodosControllerTest < ActionController::TestCase
diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb
index 4590c102..92051237 100644
--- a/test/controllers/users_controller_test.rb
+++ b/test/controllers/users_controller_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class UsersControllerTest < ActionController::TestCase
diff --git a/test/integration/context_xml_api_test.rb b/test/integration/context_xml_api_test.rb
index 71e6abab..26d5b4ec 100644
--- a/test/integration/context_xml_api_test.rb
+++ b/test/integration/context_xml_api_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ContextXmlApiTest < ActionDispatch::IntegrationTest
diff --git a/test/integration/feed_smoke_test.rb b/test/integration/feed_smoke_test.rb
index f5748d4f..6eb762bd 100644
--- a/test/integration/feed_smoke_test.rb
+++ b/test/integration/feed_smoke_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path( File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class FeedSmokeTest < ActionDispatch::IntegrationTest
diff --git a/test/integration/project_xml_api_test.rb b/test/integration/project_xml_api_test.rb
index 2b5a344b..9cfbfab8 100644
--- a/test/integration/project_xml_api_test.rb
+++ b/test/integration/project_xml_api_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ProjectXmlApiTest < ActionDispatch::IntegrationTest
@@project_name = "My New Project"
diff --git a/test/integration/recurring_todos_test.rb b/test/integration/recurring_todos_test.rb
index 39e2fc77..bad00387 100644
--- a/test/integration/recurring_todos_test.rb
+++ b/test/integration/recurring_todos_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class RecurringTodosTest < ActionDispatch::IntegrationTest
diff --git a/test/integration/stories_test.rb b/test/integration/stories_test.rb
index 7935194b..471d4f09 100644
--- a/test/integration/stories_test.rb
+++ b/test/integration/stories_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class StoriesTest < ActionDispatch::IntegrationTest
diff --git a/test/integration/todo_xml_api_test.rb b/test/integration/todo_xml_api_test.rb
index ed2458ee..384bc889 100644
--- a/test/integration/todo_xml_api_test.rb
+++ b/test/integration/todo_xml_api_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TodoXmlApiTest < ActionDispatch::IntegrationTest
@@valid_postdata = "this will succeed104"
diff --git a/test/integration/users_xml_api_test.rb b/test/integration/users_xml_api_test.rb
index 3985882d..07b25d44 100644
--- a/test/integration/users_xml_api_test.rb
+++ b/test/integration/users_xml_api_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class UsersXmlApiTest < ActionDispatch::IntegrationTest
diff --git a/test/models/attribute_handler_test.rb b/test/models/attribute_handler_test.rb
index 54d6bddd..c47f236b 100644
--- a/test/models/attribute_handler_test.rb
+++ b/test/models/attribute_handler_test.rb
@@ -1,4 +1,4 @@
-require_relative '../test_helper'
+require 'test_helper'
class AttributeHandlerTest < ActiveSupport::TestCase
fixtures :users
diff --git a/test/models/context_test.rb b/test/models/context_test.rb
index b3b56196..e699609e 100644
--- a/test/models/context_test.rb
+++ b/test/models/context_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ContextTest < ActiveSupport::TestCase
fixtures :contexts, :todos, :recurring_todos, :users, :preferences
diff --git a/test/models/is_taggable_test.rb b/test/models/is_taggable_test.rb
index dfd97400..93b7caf2 100644
--- a/test/models/is_taggable_test.rb
+++ b/test/models/is_taggable_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class IsTaggableTest < ActiveSupport::TestCase
fixtures :todos, :recurring_todos
diff --git a/test/models/notes_test.rb b/test/models/notes_test.rb
index 695c0329..c3c65d68 100644
--- a/test/models/notes_test.rb
+++ b/test/models/notes_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class NotesTest < ActiveSupport::TestCase
fixtures :notes
diff --git a/test/models/pie_chart_data_test.rb b/test/models/pie_chart_data_test.rb
index 09ac2bc2..697b6c1b 100644
--- a/test/models/pie_chart_data_test.rb
+++ b/test/models/pie_chart_data_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../minimal_test_helper')
+require 'minimal_test_helper'
require 'app/models/stats/pie_chart_data'
require 'active_support/core_ext/string'
diff --git a/test/models/preference_test.rb b/test/models/preference_test.rb
index 2fe8e273..688d003f 100644
--- a/test/models/preference_test.rb
+++ b/test/models/preference_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class PreferenceTest < ActiveSupport::TestCase
fixtures :users, :preferences
diff --git a/test/models/project_from_todo_test.rb b/test/models/project_from_todo_test.rb
index 755df908..b2d0bd24 100644
--- a/test/models/project_from_todo_test.rb
+++ b/test/models/project_from_todo_test.rb
@@ -1,4 +1,4 @@
-require_relative '../test_helper'
+require 'test_helper'
require_relative '../../lib/project_from_todo'
class ProjectFromTodoTest < ActiveSupport::TestCase
diff --git a/test/models/project_test.rb b/test/models/project_test.rb
index 0605291c..e2f7b5b2 100644
--- a/test/models/project_test.rb
+++ b/test/models/project_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class ProjectTest < ActiveSupport::TestCase
fixtures :projects, :contexts, :todos, :recurring_todos, :users, :preferences
diff --git a/test/models/recurring_todo_test.rb b/test/models/recurring_todo_test.rb
index 7ac14610..4e145f67 100644
--- a/test/models/recurring_todo_test.rb
+++ b/test/models/recurring_todo_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class RecurringTodoTest < ActiveSupport::TestCase
diff --git a/test/models/recurring_todos/abstract_recurring_todos_builder_test.rb b/test/models/recurring_todos/abstract_recurring_todos_builder_test.rb
index 5c051eb5..82429723 100644
--- a/test/models/recurring_todos/abstract_recurring_todos_builder_test.rb
+++ b/test/models/recurring_todos/abstract_recurring_todos_builder_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/abstract_repeat_pattern_test.rb b/test/models/recurring_todos/abstract_repeat_pattern_test.rb
index 339c1dac..a4304aa8 100644
--- a/test/models/recurring_todos/abstract_repeat_pattern_test.rb
+++ b/test/models/recurring_todos/abstract_repeat_pattern_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/daily_recurring_todos_builder_test.rb b/test/models/recurring_todos/daily_recurring_todos_builder_test.rb
index b6463c9b..6ceb11c7 100644
--- a/test/models/recurring_todos/daily_recurring_todos_builder_test.rb
+++ b/test/models/recurring_todos/daily_recurring_todos_builder_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/daily_repeat_pattern_test.rb b/test/models/recurring_todos/daily_repeat_pattern_test.rb
index edfd4977..520ea346 100644
--- a/test/models/recurring_todos/daily_repeat_pattern_test.rb
+++ b/test/models/recurring_todos/daily_repeat_pattern_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/form_helper_test.rb b/test/models/recurring_todos/form_helper_test.rb
index 80ae0c0c..c3a6be4e 100644
--- a/test/models/recurring_todos/form_helper_test.rb
+++ b/test/models/recurring_todos/form_helper_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/monthly_recurring_todos_builder_test.rb b/test/models/recurring_todos/monthly_recurring_todos_builder_test.rb
index f02299ca..a4d7d45a 100644
--- a/test/models/recurring_todos/monthly_recurring_todos_builder_test.rb
+++ b/test/models/recurring_todos/monthly_recurring_todos_builder_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/monthly_repeat_pattern_test.rb b/test/models/recurring_todos/monthly_repeat_pattern_test.rb
index 5603108f..67e28741 100644
--- a/test/models/recurring_todos/monthly_repeat_pattern_test.rb
+++ b/test/models/recurring_todos/monthly_repeat_pattern_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/recurring_todos_builder_test.rb b/test/models/recurring_todos/recurring_todos_builder_test.rb
index a5771f86..66d06c50 100644
--- a/test/models/recurring_todos/recurring_todos_builder_test.rb
+++ b/test/models/recurring_todos/recurring_todos_builder_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/weekly_recurring_todos_builder_test.rb b/test/models/recurring_todos/weekly_recurring_todos_builder_test.rb
index 963e9b37..284fd653 100644
--- a/test/models/recurring_todos/weekly_recurring_todos_builder_test.rb
+++ b/test/models/recurring_todos/weekly_recurring_todos_builder_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/weekly_repeat_pattern_test.rb b/test/models/recurring_todos/weekly_repeat_pattern_test.rb
index 87f87397..03983089 100644
--- a/test/models/recurring_todos/weekly_repeat_pattern_test.rb
+++ b/test/models/recurring_todos/weekly_repeat_pattern_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/yearly_recurring_todos_builder_test.rb b/test/models/recurring_todos/yearly_recurring_todos_builder_test.rb
index 51db4860..807b65ef 100644
--- a/test/models/recurring_todos/yearly_recurring_todos_builder_test.rb
+++ b/test/models/recurring_todos/yearly_recurring_todos_builder_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/recurring_todos/yearly_repeat_pattern_test.rb b/test/models/recurring_todos/yearly_repeat_pattern_test.rb
index 0514e655..7030ebf8 100644
--- a/test/models/recurring_todos/yearly_repeat_pattern_test.rb
+++ b/test/models/recurring_todos/yearly_repeat_pattern_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module RecurringTodos
diff --git a/test/models/staleness_test.rb b/test/models/staleness_test.rb
index ddbff98e..daa93130 100644
--- a/test/models/staleness_test.rb
+++ b/test/models/staleness_test.rb
@@ -1,4 +1,4 @@
-require_relative '../minimal_test_helper'
+require 'minimal_test_helper'
require_relative '../../lib/staleness'
require_relative '../../lib/user_time'
diff --git a/test/models/tag_cloud_query_test.rb b/test/models/tag_cloud_query_test.rb
index e0dc252e..a9bb9f22 100644
--- a/test/models/tag_cloud_query_test.rb
+++ b/test/models/tag_cloud_query_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TagCloudQueryTest < ActiveSupport::TestCase
diff --git a/test/models/tag_cloud_test.rb b/test/models/tag_cloud_test.rb
index ad46eadb..592ba47d 100644
--- a/test/models/tag_cloud_test.rb
+++ b/test/models/tag_cloud_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../minimal_test_helper')
+require 'minimal_test_helper'
require 'app/models/stats/tag_cloud'
class TagCloudTest < Minitest::Test
diff --git a/test/models/tag_test.rb b/test/models/tag_test.rb
index 556f6554..b070554c 100644
--- a/test/models/tag_test.rb
+++ b/test/models/tag_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TagTest < ActiveSupport::TestCase
fixtures :tags
diff --git a/test/models/tagging_test.rb b/test/models/tagging_test.rb
index 7b6c7bd9..b832d09e 100644
--- a/test/models/tagging_test.rb
+++ b/test/models/tagging_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TaggingTest < ActiveSupport::TestCase
fixtures :taggings, :tags
diff --git a/test/models/time_to_complete_test.rb b/test/models/time_to_complete_test.rb
index 7ab9896e..ea83d487 100644
--- a/test/models/time_to_complete_test.rb
+++ b/test/models/time_to_complete_test.rb
@@ -1,6 +1,6 @@
require 'date'
require 'time'
-require './test/minimal_test_helper'
+require 'minimal_test_helper'
require 'app/models/stats/time_to_complete'
FakeTask = Struct.new(:created_at, :completed_at)
diff --git a/test/models/todo_create_params_helper_test.rb b/test/models/todo_create_params_helper_test.rb
index eb9b37d9..61326598 100644
--- a/test/models/todo_create_params_helper_test.rb
+++ b/test/models/todo_create_params_helper_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
require 'todos_controller'
class TodoCreateParamsHelperTest < ActiveSupport::TestCase
diff --git a/test/models/todo_from_rich_message_test.rb b/test/models/todo_from_rich_message_test.rb
index 01d9fbb6..d8935742 100644
--- a/test/models/todo_from_rich_message_test.rb
+++ b/test/models/todo_from_rich_message_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TodoFromRichMessageTest < ActiveSupport::TestCase
diff --git a/test/models/todo_test.rb b/test/models/todo_test.rb
index 3786b417..72e19cb0 100644
--- a/test/models/todo_test.rb
+++ b/test/models/todo_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class TodoTest < ActiveSupport::TestCase
fixtures :todos, :recurring_todos, :users, :contexts, :preferences, :tags, :taggings, :projects
diff --git a/test/models/todos/calendar_test.rb b/test/models/todos/calendar_test.rb
index 31442a19..f85845e6 100644
--- a/test/models/todos/calendar_test.rb
+++ b/test/models/todos/calendar_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module Todos
class CalendarTest < ActiveSupport::TestCase
diff --git a/test/models/todos/done_todos_test.rb b/test/models/todos/done_todos_test.rb
index 17a7dcfd..68917e91 100644
--- a/test/models/todos/done_todos_test.rb
+++ b/test/models/todos/done_todos_test.rb
@@ -1,4 +1,4 @@
-require_relative '../../test_helper'
+require 'test_helper'
module Todos
class DoneTodosTest < ActiveSupport::TestCase
diff --git a/test/models/tracks_cli/tracks_api_test.rb b/test/models/tracks_cli/tracks_api_test.rb
index dbe51523..a1504c58 100644
--- a/test/models/tracks_cli/tracks_api_test.rb
+++ b/test/models/tracks_cli/tracks_api_test.rb
@@ -1,5 +1,5 @@
require 'net/https'
-require './test/minimal_test_helper'
+require 'minimal_test_helper'
require './doc/tracks_cli/tracks_api'
module TracksCli
diff --git a/test/models/tracks_cli/tracks_xml_builder_test.rb b/test/models/tracks_cli/tracks_xml_builder_test.rb
index 71b62571..4e9eae0f 100644
--- a/test/models/tracks_cli/tracks_xml_builder_test.rb
+++ b/test/models/tracks_cli/tracks_xml_builder_test.rb
@@ -1,4 +1,4 @@
-require './test/minimal_test_helper'
+require 'minimal_test_helper'
require './doc/tracks_cli/tracks_xml_builder'
require 'active_support/time_with_zone'
diff --git a/test/models/user_test.rb b/test/models/user_test.rb
index 7929b8a8..47763fbf 100644
--- a/test/models/user_test.rb
+++ b/test/models/user_test.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+require 'test_helper'
class UserTest < ActiveSupport::TestCase
fixtures :users, :preferences, :projects, :contexts, :todos, :recurring_todos
From fd24dc83b129b66e2594dc2e7884faeef1c5f6d3 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 16 May 2014 18:14:30 -0400
Subject: [PATCH 32/55] Use aruba and actionpack-xml_parser from rubygems
The released versions have caught up with Tracks' needs,
so it's no longer necessary to fetch them from source.
---
Gemfile | 4 ++--
Gemfile.lock | 26 ++++++++------------------
2 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/Gemfile b/Gemfile
index ab4154dd..d9fc87d0 100644
--- a/Gemfile
+++ b/Gemfile
@@ -7,7 +7,7 @@ gem 'coffee-rails', '~>4.0'
#gem 'json'
# todo: remove xml api
-gem 'actionpack-xml_parser', git: 'https://github.com/rails/actionpack-xml_parser'
+gem 'actionpack-xml_parser', '>=1.0.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer'
@@ -58,7 +58,7 @@ group :test do
gem "database_cleaner"
gem "mocha", :require => false
- gem "aruba", git: 'https://github.com/cucumber/aruba', :require => false # need 0.5.4 for piping files; 0.5.3 is latest
+ gem "aruba", ">=0.5.4", :require => false
# Note that > 2.14 has problems, see:
# https://code.google.com/p/selenium/issues/detail?id=3075
diff --git a/Gemfile.lock b/Gemfile.lock
index 28505feb..54dd24d5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,19 +1,3 @@
-GIT
- remote: https://github.com/cucumber/aruba
- revision: fccb412d18d699b7ecacd0da6b2e5338987cf4eb
- specs:
- aruba (0.5.4)
- childprocess (>= 0.3.6)
- cucumber (>= 1.1.1)
- rspec-expectations (>= 2.7.0)
-
-GIT
- remote: https://github.com/rails/actionpack-xml_parser
- revision: e1516064761ea26502cd79b283f6af0fa2b1edf5
- specs:
- actionpack-xml_parser (1.0.1)
- actionpack (>= 4.0.0, < 5)
-
GEM
remote: https://rubygems.org/
specs:
@@ -28,6 +12,8 @@ GEM
activesupport (= 4.1.1)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
+ actionpack-xml_parser (1.0.1)
+ actionpack (>= 4.0.0.rc1)
actionview (4.1.1)
activesupport (= 4.1.1)
builder (~> 3.1)
@@ -48,6 +34,10 @@ GEM
acts_as_list (0.4.0)
activerecord (>= 3.0)
arel (5.0.1.20140414130214)
+ aruba (0.5.4)
+ childprocess (>= 0.3.6)
+ cucumber (>= 1.1.1)
+ rspec-expectations (>= 2.7.0)
bcrypt-ruby (3.0.1)
builder (3.2.2)
bullet (4.9.0)
@@ -213,9 +203,9 @@ PLATFORMS
DEPENDENCIES
RedCloth
aasm
- actionpack-xml_parser!
+ actionpack-xml_parser (>= 1.0.1)
acts_as_list
- aruba!
+ aruba (>= 0.5.4)
bcrypt-ruby (~> 3.0.0)
bullet
cache_digests
From a1d3934bc6e0a45e81924953b8c0fa25589289ac Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 27 May 2014 23:18:40 -0400
Subject: [PATCH 33/55] Allow Travis to use default bundler version
---
.travis.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 91bfd9e8..ad121fc8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,8 +8,6 @@ rvm:
bundler_args: --without development
before_install:
-before_install:
- - "gem install bundler -v=1.5.1"
- "mysql -e 'create database tracks_test;'"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
From 737263d8663ac2646eaf704f53f0a2a2f66d5ef2 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 30 May 2014 21:48:36 -0400
Subject: [PATCH 34/55] Add Gemnasium badge
[ci skip]
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 9c659eb6..24f99f98 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,7 @@ of the License, or (at your option) any later version.
[](https://travis-ci.org/TracksApp/tracks)
[](https://codeclimate.com/github/TracksApp/tracks)
+[](https://gemnasium.com/TracksApp/tracks)
Full instructions for both new installations and upgrades from older installations of Tracks
can be found within the /doc directory.
From e0779a0b0738d514c893b4d2915e89bcfe8f280a Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Mon, 2 Jun 2014 20:52:59 -0400
Subject: [PATCH 35/55] Use bcrypt gem instead of obsolete bcrypt-ruby
---
Gemfile | 2 +-
Gemfile.lock | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Gemfile b/Gemfile
index d9fc87d0..568ef3b0 100644
--- a/Gemfile
+++ b/Gemfile
@@ -33,7 +33,7 @@ gem "rails_autolink"
gem "cache_digests"
# To use ActiveModel has_secure_password
-gem 'bcrypt-ruby', '~> 3.0.0'
+gem 'bcrypt', '~> 3.1.3'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# gem 'turbolinks'
diff --git a/Gemfile.lock b/Gemfile.lock
index 54dd24d5..cceaf06a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -38,7 +38,7 @@ GEM
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
- bcrypt-ruby (3.0.1)
+ bcrypt (3.1.7)
builder (3.2.2)
bullet (4.9.0)
activesupport
@@ -206,7 +206,7 @@ DEPENDENCIES
actionpack-xml_parser (>= 1.0.1)
acts_as_list
aruba (>= 0.5.4)
- bcrypt-ruby (~> 3.0.0)
+ bcrypt (~> 3.1.3)
bullet
cache_digests
capybara
From dbf1cb61ff4409dcf0a0eb3a1222a5d1239ef0e8 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Wed, 4 Jun 2014 17:05:03 -0400
Subject: [PATCH 36/55] Remove links to old forum from docs
[ci skip]
---
README.md | 3 +--
doc/CHANGELOG | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 24f99f98..c690252c 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,6 @@ of the License, or (at your option) any later version.
* Source at GitHub: https://github.com/TracksApp/tracks
* Assembla space (for bug reports and feature requests): https://www.assembla.com/spaces/tracks-tickets/tickets
* Wiki (community contributed information): https://github.com/TracksApp/tracks/wiki
-* Forum (read-only): http://getontracks.org/forums/
* Mailing list: http://groups.google.com/group/TracksApp
* Original developer: bsag (http://www.rousette.org.uk/)
* Contributors: https://github.com/TracksApp/tracks/wiki/Contributors
@@ -30,7 +29,7 @@ different configurations which can be used (e.g. running Tracks on your local
computer or on a remote server). If you choose the appropriate section for your
situation (installation vs. upgrade), and use the easiest (recommended) method,
you should find the instructions easy to follow. If you encounter problems, try
-searching the wiki, forum or mailing list (URLs above), and ask a question if
+searching the wiki or mailing list (URLs above), and ask a question if
you cannot find a solution to your problem.
The wiki has a lot of user contributed installation HOWTOs for various webhosts, specific OS's and more.
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index eaa8ba23..4818014e 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -5,7 +5,6 @@
* Source at GitHub: https://github.com/TracksApp/tracks
* Assembla space (for bug reports and feature requests): https://www.assembla.com/spaces/tracks-tickets/tickets
* Wiki (community contributed information): https://github.com/TracksApp/tracks/wiki
-* Forum (read-only): http://getontracks.org/forums/
* Mailing list: http://groups.google.com/group/TracksApp
* Original developer: bsag (http://www.rousette.org.uk/)
* Contributors: https://github.com/TracksApp/tracks/wiki/Contributors
From 50b09811fc9f9521157f3d9408b4ba2dfbbaffc1 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 12:07:30 -0400
Subject: [PATCH 37/55] Fix check for whether todo changed containers
---
app/helpers/todos_helper.rb | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index bdf7118e..269fca8b 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -508,13 +508,14 @@ module TodosHelper
end
def todo_moved_out_of_container
- return
- # moved from one project container to another
- (@project_changed && @group_view_by=='project') ||
- # moved from one context container to another
- (@context_changed && @group_view_by=='context') ||
- # moved from actions-without-project container to another
- (@context_changed && @group_view_by=='project' && @todo.project_id.nil?)
+ # moved from one project container to another
+ moved_project = @project_changed && @group_view_by=='project'
+ # moved from one context container to another
+ moved_context = @context_changed && @group_view_by=='context'
+ # moved from actions-without-project container to another
+ moved_without_project = @context_changed && @group_view_by=='project' && @todo.project_id.nil?
+
+ return moved_project || moved_context || moved_without_project
end
def update_needs_to_hide_container
From 38387c844d7ca3dd8bac4d4f20f34a418bef7573 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 12:28:51 -0400
Subject: [PATCH 38/55] Speed up feature tests by disabling jQuery effects
---
app/assets/javascripts/application.js | 1 +
app/assets/javascripts/disable_fx_in_test.js.erb | 3 +++
2 files changed, 4 insertions(+)
create mode 100644 app/assets/javascripts/disable_fx_in_test.js.erb
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 8c61509e..7fe46587 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -15,6 +15,7 @@
// Stuff in app/assets
//= require tracks.js
+//= require disable_fx_in_test
// Stuff in vendor/assets
//= require jquery-ui-1.10.0.custom.min
diff --git a/app/assets/javascripts/disable_fx_in_test.js.erb b/app/assets/javascripts/disable_fx_in_test.js.erb
new file mode 100644
index 00000000..89064c9d
--- /dev/null
+++ b/app/assets/javascripts/disable_fx_in_test.js.erb
@@ -0,0 +1,3 @@
+<% if Rails.env.test? || Rails.env.cucumber? %>
+$.fx.off = true;
+<% end %>
From 3fc9173d54433ca4c7a767944edd6169ef6cda12 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 14:25:28 -0400
Subject: [PATCH 39/55] Simplify feature test to make date-independent
---
features/step_definitions/generic_steps.rb | 5 -----
features/support/hooks.rb | 4 ----
features/view_done.feature | 13 +------------
3 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/features/step_definitions/generic_steps.rb b/features/step_definitions/generic_steps.rb
index b48c2ccb..37d91655 100644
--- a/features/step_definitions/generic_steps.rb
+++ b/features/step_definitions/generic_steps.rb
@@ -10,11 +10,6 @@ Given /^I am working on the mobile interface$/ do
@mobile_interface = true
end
-Given /^the date is "(.*?)"$/ do |date|
- # remember to tag the scenario with @reset_time to reset this travel
- travel_to date
-end
-
Given(/^I have selected the view for group by (project|context)$/) do |grouping|
@group_view_by = grouping
end
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 2895076c..188c7ffe 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -7,7 +7,3 @@ Before('@aruba') do
@aruba_timeout_seconds = 5
# print "\nsetting timeout for aruba to #{@aruba_timeout_seconds}\n"
end
-
-After('@reset_time') do
- travel_back
-end
\ No newline at end of file
diff --git a/features/view_done.feature b/features/view_done.feature
index efb6072a..ea4bf133 100644
--- a/features/view_done.feature
+++ b/features/view_done.feature
@@ -153,24 +153,13 @@ Feature: Show done
| all done actions page for project "test project"| "test project" project | |
| all done actions page for tag "starred" | home page | in the context container for "@pc" |
- @javascript @reset_time
+ @javascript
Scenario: Activating the last todo will show empty message
- Given the date is "2013-03-11"
- And I have a completed todo with description "todo 2" in context "@pc" completed 2 days ago
- And I have a completed todo with description "todo 3" in context "@pc" completed 7 days ago
When I go to the done actions page
Then I should see "todo 1" in the done today container
- And I should see "todo 2" in the done this week container
- And I should see "todo 3" in the done this month container
When I mark the completed todo "todo 1" active
Then I should not see the todo "todo 1"
And I should see empty message for done today of done actions
- When I mark the completed todo "todo 2" active
- Then I should not see the todo "todo 2"
- And I should see empty message for done this week of done actions
- When I mark the completed todo "todo 3" active
- Then I should not see the todo "todo 3"
- And I should see empty message for done this month of done actions
@javascript
Scenario Outline: I can toggle the star of a todo from the done pages
From 9469bacc2f6669796a05b848302a8196cc64ea3a Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 15:57:29 -0400
Subject: [PATCH 40/55] Remove db:migrate from ci task
Rails 4.1 auto-manages the database using schema.rb
---
lib/tasks/continuous_integration.rake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/tasks/continuous_integration.rake b/lib/tasks/continuous_integration.rake
index f54ede26..189d7263 100644
--- a/lib/tasks/continuous_integration.rake
+++ b/lib/tasks/continuous_integration.rake
@@ -9,7 +9,7 @@ task :ci do |t|
require 'simplecov'
SimpleCov.start 'rails'
- [:environment, 'db:migrate', 'test:all', 'cucumber'].each do |t|
+ [:environment, 'test:all', 'cucumber'].each do |t|
Rake::Task[t].invoke
end
-end
\ No newline at end of file
+end
From a4388f0bd645edce0b07ff0dd3d09b9bd3d2f13e Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 16:15:10 -0400
Subject: [PATCH 41/55] Tidy up the command Travis uses to execute tests
---
.travis.yml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index ad121fc8..5a710e86 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,8 +14,11 @@ before_install:
- "cp config/site.yml.tmpl config/site.yml"
- "cp config/database.yml.tmpl config/database.yml"
-script: "CODECLIMATE_REPO_TOKEN=5c52fdd2bbcd0734d56ddb2c3cbaac782da345273e8689d25f54a065ccc3397c bin/rake ci RACK_ENV=test"
+script: "bin/rake ci"
notifications:
email: false
+addons:
+ code_climate:
+ repo_token: 5c52fdd2bbcd0734d56ddb2c3cbaac782da345273e8689d25f54a065ccc3397c
From d793e1724877d5f0c9fa1de1cfb5eaad79ea7b0d Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 17:22:57 -0400
Subject: [PATCH 42/55] Increase Aruba timeout
---
features/support/hooks.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 188c7ffe..05c2558d 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -4,6 +4,6 @@ AfterStep('@pause') do
end
Before('@aruba') do
- @aruba_timeout_seconds = 5
+ @aruba_timeout_seconds = 10
# print "\nsetting timeout for aruba to #{@aruba_timeout_seconds}\n"
end
From 4ee8c2e7fdddb9e9f4e20569057f5964dce201ed Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Tue, 10 Jun 2014 17:50:47 -0400
Subject: [PATCH 43/55] Remove executable bit from files in app/
---
app/helpers/stats_helper.rb | 0
app/views/stats/_actions.html.erb | 0
app/views/stats/_chart.html.erb | 0
app/views/stats/_contexts.html.erb | 0
app/views/stats/_projects.html.erb | 0
app/views/stats/_tags.html.erb | 0
app/views/stats/_totals.html.erb | 0
app/views/stats/actions_completion_time_data.html.erb | 0
app/views/stats/actions_day_of_week_30days_data.html.erb | 0
app/views/stats/actions_day_of_week_all_data.html.erb | 0
app/views/stats/actions_done_last12months_data.html.erb | 0
app/views/stats/actions_done_last30days_data.html.erb | 0
app/views/stats/actions_running_time_data.html.erb | 0
app/views/stats/actions_time_of_day_30days_data.html.erb | 0
app/views/stats/actions_time_of_day_all_data.html.erb | 0
app/views/stats/actions_visible_running_time_data.html.erb | 0
app/views/stats/index.html.erb | 0
app/views/stats/pie_chart_data.html.erb | 0
18 files changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 app/helpers/stats_helper.rb
mode change 100755 => 100644 app/views/stats/_actions.html.erb
mode change 100755 => 100644 app/views/stats/_chart.html.erb
mode change 100755 => 100644 app/views/stats/_contexts.html.erb
mode change 100755 => 100644 app/views/stats/_projects.html.erb
mode change 100755 => 100644 app/views/stats/_tags.html.erb
mode change 100755 => 100644 app/views/stats/_totals.html.erb
mode change 100755 => 100644 app/views/stats/actions_completion_time_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_day_of_week_30days_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_day_of_week_all_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_done_last12months_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_done_last30days_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_running_time_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_time_of_day_30days_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_time_of_day_all_data.html.erb
mode change 100755 => 100644 app/views/stats/actions_visible_running_time_data.html.erb
mode change 100755 => 100644 app/views/stats/index.html.erb
mode change 100755 => 100644 app/views/stats/pie_chart_data.html.erb
diff --git a/app/helpers/stats_helper.rb b/app/helpers/stats_helper.rb
old mode 100755
new mode 100644
diff --git a/app/views/stats/_actions.html.erb b/app/views/stats/_actions.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/_chart.html.erb b/app/views/stats/_chart.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/_contexts.html.erb b/app/views/stats/_contexts.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/_projects.html.erb b/app/views/stats/_projects.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/_tags.html.erb b/app/views/stats/_tags.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/_totals.html.erb b/app/views/stats/_totals.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_completion_time_data.html.erb b/app/views/stats/actions_completion_time_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_day_of_week_30days_data.html.erb b/app/views/stats/actions_day_of_week_30days_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_day_of_week_all_data.html.erb b/app/views/stats/actions_day_of_week_all_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_done_last12months_data.html.erb b/app/views/stats/actions_done_last12months_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_done_last30days_data.html.erb b/app/views/stats/actions_done_last30days_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_running_time_data.html.erb b/app/views/stats/actions_running_time_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_time_of_day_30days_data.html.erb b/app/views/stats/actions_time_of_day_30days_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_time_of_day_all_data.html.erb b/app/views/stats/actions_time_of_day_all_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/actions_visible_running_time_data.html.erb b/app/views/stats/actions_visible_running_time_data.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/index.html.erb b/app/views/stats/index.html.erb
old mode 100755
new mode 100644
diff --git a/app/views/stats/pie_chart_data.html.erb b/app/views/stats/pie_chart_data.html.erb
old mode 100755
new mode 100644
From 7a3f90a020069a695b58a325aaade5ac40a6c1a0 Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Fri, 16 May 2014 15:42:03 -0400
Subject: [PATCH 44/55] Use RSpec 'expect' instead of 'should'
---
features/step_definitions/container_steps.rb | 8 +--
.../step_definitions/context_list_steps.rb | 10 +--
features/step_definitions/context_steps.rb | 12 ++--
.../step_definitions/dependencies_steps.rb | 28 ++++----
features/step_definitions/feedlist_steps.rb | 10 +--
features/step_definitions/generic_steps.rb | 6 +-
.../step_definitions/integration_steps.rb | 6 +-
features/step_definitions/note_steps.rb | 16 ++---
.../step_definitions/project_list_steps.rb | 38 +++++------
features/step_definitions/project_steps.rb | 66 +++++++++----------
.../step_definitions/recurring_todo_steps.rb | 36 +++++-----
.../step_definitions/shared_new_todo_steps.rb | 8 +--
features/step_definitions/stats_steps.rb | 2 +-
.../step_definitions/todo_create_steps.rb | 6 +-
features/step_definitions/todo_edit_steps.rb | 38 +++++------
features/step_definitions/todo_steps.rb | 60 ++++++++---------
features/step_definitions/user_steps.rb | 10 +--
features/step_definitions/web_steps.rb | 62 ++++-------------
features/support/tracks_form_helper.rb | 16 ++---
features/support/tracks_step_helper.rb | 18 ++---
20 files changed, 208 insertions(+), 248 deletions(-)
diff --git a/features/step_definitions/container_steps.rb b/features/step_definitions/container_steps.rb
index c75838ae..40aef4f4 100644
--- a/features/step_definitions/container_steps.rb
+++ b/features/step_definitions/container_steps.rb
@@ -1,12 +1,12 @@
When(/^I collapse the context container of "([^"]*)"$/) do |context_name|
toggle = page.find(:xpath, toggle_context_container_xpath(find_context(context_name)))
- toggle.should be_visible
+ expect(toggle).to be_visible
toggle.click
end
When(/^I collapse the project container of "(.*?)"$/) do |project_name|
toggle = page.find(:xpath, toggle_project_container_xpath(find_project(project_name)))
- toggle.should be_visible
+ expect(toggle).to be_visible
toggle.click
end
@@ -107,7 +107,7 @@ end
Then /^I should see "([^"]*)" in the due next month container$/ do |todo_description|
within "div#due_after_this_month_container" do
- page.should have_css("div#line_todo_#{find_todo(todo_description).id}")
+ expect(page).to have_css("div#line_todo_#{find_todo(todo_description).id}")
end
end
@@ -148,7 +148,7 @@ Then /^I should (see|not see) empty message for (done today|done this week|done
css = "div#deferred_pending_container-empty-d" if state == "deferred todos"
elem = find(css)
- elem.should_not be_nil
+ expect(elem).to_not be_nil
check_elem_visibility(visible, elem)
end
\ No newline at end of file
diff --git a/features/step_definitions/context_list_steps.rb b/features/step_definitions/context_list_steps.rb
index 3bddc8b1..83beaba6 100644
--- a/features/step_definitions/context_list_steps.rb
+++ b/features/step_definitions/context_list_steps.rb
@@ -4,10 +4,10 @@ When /^I delete the context "([^\"]*)"$/ do |context_name|
handle_js_confirm do
click_link "delete_context_#{context.id}"
end
- get_confirm_text.should == "Are you sure that you want to delete the context '#{context_name}'? Be aware that this will also delete all (repeating) actions in this context!"
+ expect(get_confirm_text).to eq("Are you sure that you want to delete the context '#{context_name}'? Be aware that this will also delete all (repeating) actions in this context!")
# wait until the context is removed
- page.should_not have_css("a#delete_context_#{context.id}")
+ expect(page).to_not have_css("a#delete_context_#{context.id}")
end
When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name|
@@ -61,7 +61,7 @@ When /^I edit the state of context "(.*?)" to closed$/ do |context_name|
end
Then /^context "([^"]*)" should be above context "([^"]*)"$/ do |context_high, context_low|
- context_list_find_index(context_high).should < context_list_find_index(context_low)
+ expect(context_list_find_index(context_high)).to be < context_list_find_index(context_low)
end
Then(/^I should see that a context named "([^"]*)" (is|is not) present$/) do |context_name, present|
@@ -87,9 +87,9 @@ Then /^the new context form should (be|not be) visible$/ do |visible|
end
Then /^the context list badge for ([^"]*) contexts should show (\d+)$/ do |state_name, count|
- find("span##{state_name}-contexts-count").text.should == count
+ expect(find("span##{state_name}-contexts-count").text).to eq(count)
end
Then /^I should (see|not see) empty message for (active|hidden|closed) contexts$/ do |visible, state|
check_css_visibility(visible, "div##{state}-contexts-empty-nd")
-end
\ No newline at end of file
+end
diff --git a/features/step_definitions/context_steps.rb b/features/step_definitions/context_steps.rb
index c13ae0d7..6d4719a5 100644
--- a/features/step_definitions/context_steps.rb
+++ b/features/step_definitions/context_steps.rb
@@ -5,7 +5,7 @@ end
Given /^there exists (an active|a hidden|a closed) context called "([^"]*)" for user "([^"]*)"$/ do |state, context_name, login|
user = User.where(:login => login).first
- user.should_not be_nil
+ expect(user).to_not be_nil
context_state = {"an active" => "active", "a hidden" => "hidden", "a closed" => "closed"}[state]
@context = user.contexts.where(:name => context_name, :state => context_state).first_or_create
end
@@ -63,11 +63,11 @@ end
Then /^he should see that a context named "([^\"]*)" (is|is not) present$/ do |context_name, visible|
context = @current_user.contexts.where(:name => context_name).first
if visible == "is"
- context.should_not be_nil
+ expect(context).to_not be_nil
css = "div#context_#{context.id} div.context_description a"
- page.should have_selector(css, :visible => true)
- page.find(:css, css).text.should == context_name
+ expect(page).to have_selector(css, :visible => true)
+ expect(page.find(:css, css).text).to eq(context_name)
else
- page.should_not have_selector("div#context_#{context.id} div.context_description a", :visible => true) if context
+ expect(page).to_not have_selector("div#context_#{context.id} div.context_description a", :visible => true) if context
end
-end
\ No newline at end of file
+end
diff --git a/features/step_definitions/dependencies_steps.rb b/features/step_definitions/dependencies_steps.rb
index f48cfada..c2db3229 100644
--- a/features/step_definitions/dependencies_steps.rb
+++ b/features/step_definitions/dependencies_steps.rb
@@ -18,7 +18,7 @@ end
When /^I expand the dependencies of "([^\"]*)"$/ do |todo_name|
todo = Todo.where(:description=>todo_name).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
expand_img_locator = "//div[@id='line_todo_#{todo.id}']/div/a[@class='show_successors']/img"
page.find(:xpath, expand_img_locator).click
@@ -28,9 +28,9 @@ end
When /^I edit the dependency of "([^"]*)" to add "([^"]*)" as predecessor$/ do |todo_description, predecessor_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
predecessor = @current_user.todos.where(:description => predecessor_description).first
- predecessor.should_not be_nil
+ expect(predecessor).to_not be_nil
open_edit_form_for(todo)
@@ -43,29 +43,29 @@ When /^I edit the dependency of "([^"]*)" to add "([^"]*)" as predecessor$/ do |
page.execute_script %Q{$("#{form_css}").find('input[id$="predecessor_input"]').autocomplete('search')} if Capybara.javascript_driver == :webkit
# wait for auto complete
- page.should have_css("a.ui-state-focus")
+ expect(page).to have_css("a.ui-state-focus")
# click first line
page.find(:css, "ul li a.ui-state-focus").click
# wait for the new dependency to be added to the list
- page.should have_css("li#pred_#{predecessor.id}")
+ expect(page).to have_css("li#pred_#{predecessor.id}")
submit_edit_todo_form(todo)
end
When /^I edit the dependency of "([^"]*)" to remove "([^"]*)" as predecessor$/ do |todo_description, predecessor_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
predecessor = @current_user.todos.where(:description => predecessor_description).first
- predecessor.should_not be_nil
+ expect(predecessor).to_not be_nil
open_edit_form_for(todo)
delete_dep_button = "//form[@id='form_todo_#{todo.id}']//img[@id='delete_dep_#{predecessor.id}']"
page.find(:xpath, delete_dep_button).click
- page.should_not have_xpath(delete_dep_button)
+ expect(page).to_not have_xpath(delete_dep_button)
submit_edit_todo_form(todo)
wait_for_ajax
@@ -74,7 +74,7 @@ end
When /^I edit the dependency of "([^"]*)" to "([^"]*)"$/ do |todo_name, deps|
todo = @dep_todo = @current_user.todos.where(:description => todo_name).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
fill_in "predecessor_list_todo_#{todo.id}", :with => deps
@@ -83,7 +83,7 @@ end
Then /^the successors of "(.*)" should include "(.*)"$/ do |parent_name, child_name|
parent = @current_user.todos.where(:description => parent_name).first
- parent.should_not be_nil
+ expect(parent).to_not be_nil
# wait until the successor is added. TODO: make this not loop indefinitly
wait_until do
@@ -95,7 +95,7 @@ end
Then /^I should see "([^\"]*)" within the dependencies of "([^\"]*)"$/ do |successor_description, todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
# open successors
within "div#line_todo_#{todo.id}" do
@@ -109,14 +109,14 @@ end
Then /^I should not see "([^"]*)" within the dependencies of "([^"]*)"$/ do |successor_description, todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
step "I should not see \"#{successor_description}\" within \"div#line_todo_#{todo.id}\""
end
Then /^I should see that "([^"]*)" does not have dependencies$/ do |todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
dependencies_icon = "//div[@id='line_todo_#{todo.id}']/div/a[@class='show_successors']/img"
- page.should_not have_xpath(dependencies_icon)
+ expect(page).to_not have_xpath(dependencies_icon)
end
\ No newline at end of file
diff --git a/features/step_definitions/feedlist_steps.rb b/features/step_definitions/feedlist_steps.rb
index 39a4a9c2..ffe5160b 100644
--- a/features/step_definitions/feedlist_steps.rb
+++ b/features/step_definitions/feedlist_steps.rb
@@ -7,23 +7,23 @@ Then /^I should see a message that you need a project to get feeds for projects$
end
Then /^I should see feeds for projects$/ do
- page.should have_css("select#feed-projects option[value='#{@current_user.projects.first.id}']")
+ expect(page).to have_css("select#feed-projects option[value='#{@current_user.projects.first.id}']")
end
Then /^I should see feeds for contexts$/ do
- page.should have_css("select#feed-contexts option[value='#{@current_user.contexts.first.id}']")
+ expect(page).to have_css("select#feed-contexts option[value='#{@current_user.contexts.first.id}']")
end
Then /^I should see "([^"]*)" as the selected project$/ do |project_name|
- page.should have_css 'select#feed-projects option[selected="selected"]'
+ expect(page).to have_css('select#feed-projects option[selected="selected"]')
end
Then /^I should see "([^"]*)" as the selected context$/ do |context_name|
- page.should have_css 'select#feed-contexts option[selected="selected"]'
+ expect(page).to have_css('select#feed-contexts option[selected="selected"]')
end
Then /^I should see feeds for "([^"]*)" in list of "([^"]*)"$/ do |name, list_type|
wait_for_ajax
xpath= "//div[@id='feeds-for-#{list_type}']//strong"
- name.should == find(:xpath, xpath).text
+ expect(name).to eq(find(:xpath, xpath).text)
end
diff --git a/features/step_definitions/generic_steps.rb b/features/step_definitions/generic_steps.rb
index 37d91655..0a4f3d24 100644
--- a/features/step_definitions/generic_steps.rb
+++ b/features/step_definitions/generic_steps.rb
@@ -16,15 +16,15 @@ end
Then /the badge should show (.*)/ do |number|
badge = find("span#badge_count").text.to_i
- badge.should == number.to_i
+ expect(badge).to eq(number.to_i)
end
Then(/^I should see an error flash message saying "([^"]*)"$/) do |message|
xpath = "//div[@id='message_holder']/h4[@id='flash']"
- page.should have_xpath(xpath, :visible => true)
+ expect(page).to have_xpath(xpath, :visible => true)
text = page.find(:xpath, xpath).text
- text.should == message
+ expect(text).to eq(message)
end
Then /^I should see "([^"]*)" $/ do |text|
diff --git a/features/step_definitions/integration_steps.rb b/features/step_definitions/integration_steps.rb
index b9c39c56..bf5fba5c 100644
--- a/features/step_definitions/integration_steps.rb
+++ b/features/step_definitions/integration_steps.rb
@@ -8,13 +8,13 @@ Then /^I should see scripts$/ do
end
Then /^I should see a script "([^\"]*)" for "([^\"]*)"$/ do |script, context_name|
- page.should have_css("##{script}", :visible => true)
+ expect(page).to have_css("##{script}", :visible => true)
context = Context.where(:name => context_name).first
- page.should have_content("#{context.id} (* #{context_name} *)")
+ expect(page).to have_content("#{context.id} (* #{context_name} *)")
# make sure the text is found within the textarea
script_source = page.find(:xpath, "//textarea[@id='#{script}']").text
- script_source.should =~ /#{context.id} \(\* #{context_name} \*\)/
+ expect(script_source).to match(/#{context.id} \(\* #{context_name} \*\)/)
end
diff --git a/features/step_definitions/note_steps.rb b/features/step_definitions/note_steps.rb
index eebd1e4e..586a1382 100644
--- a/features/step_definitions/note_steps.rb
+++ b/features/step_definitions/note_steps.rb
@@ -10,9 +10,9 @@ When /^I delete the first note$/ do
handle_js_confirm do
click_link "delete_note_#{id}"
end
- get_confirm_text.should == "Are you sure that you want to delete the note '#{id}'?"
+ expect(get_confirm_text).to eq("Are you sure that you want to delete the note '#{id}'?")
- page.should_not have_css("a#delete_note_#{id}")
+ expect(page).to_not have_css("a#delete_note_#{id}")
end
When /^I click the icon next to the note$/ do
@@ -32,7 +32,7 @@ end
When(/^I toggle the note of "([^"]*)"$/) do |todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath = "//div[@id='line_todo_#{todo.id}']/div/a/img"
page.find(:xpath, xpath).click
@@ -52,7 +52,7 @@ Then /^(.*) notes should be visible$/ do |number|
# count number of project_notes
count = 0
page.all("div.project_notes").each { |node| count += 1 }
- count.should == number.to_i
+ expect(count).to eq(number.to_i)
end
Then /^I should see note "([^\"]*)" on the "([^\"]*)" project page$/ do |note, project|
@@ -71,7 +71,7 @@ Then /^the first note should disappear$/ do
id = title.split(' ').last
note = "div#note_#{id}"
- page.should_not have_css(note, :visible=>true)
+ expect(page).to_not have_css(note, :visible=>true)
end
Then /^I should see the note text$/ do
@@ -79,9 +79,9 @@ Then /^I should see the note text$/ do
end
Then /^I should not see the note "([^"]*)"$/ do |note_content|
- page.should_not have_selector("div", :text => note_content, :visible => true)
+ expect(page).to_not have_selector("div", :text => note_content, :visible => true)
end
Then /^I should see the note "([^"]*)"$/ do |note_content|
- page.all("div", :text => note_content).first.should be_visible
-end
\ No newline at end of file
+ expect(page.all("div", :text => note_content).first).to be_visible
+end
diff --git a/features/step_definitions/project_list_steps.rb b/features/step_definitions/project_list_steps.rb
index 22ca8c23..6f8772d0 100644
--- a/features/step_definitions/project_list_steps.rb
+++ b/features/step_definitions/project_list_steps.rb
@@ -1,11 +1,11 @@
When /^I delete project "([^"]*)"$/ do |project_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
handle_js_confirm do
click_link "delete_project_#{project.id}"
end
- get_confirm_text.should == "Are you sure that you want to delete the project '#{project_name}'?"
+ expect(get_confirm_text).to eq("Are you sure that you want to delete the project '#{project_name}'?")
wait_until do
!page.has_css?("a#delete_project_#{project.id}")
@@ -40,7 +40,7 @@ When /^I sort the active list alphabetically$/ do
end
wait_for_ajax
end
- get_confirm_text.should == "Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order."
+ expect(get_confirm_text).to eq("Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order.")
end
When /^I sort the active list by number of tasks$/ do
@@ -50,7 +50,7 @@ When /^I sort the active list by number of tasks$/ do
end
wait_for_ajax
end
- get_confirm_text.should == "Are you sure that you want to sort these projects by the number of tasks? This will replace the existing sort order."
+ expect(get_confirm_text).to eq("Are you sure that you want to sort these projects by the number of tasks? This will replace the existing sort order.")
end
Then /^I should see that a project named "([^"]*)" is not present$/ do |project_name|
@@ -75,34 +75,34 @@ end
Then(/^I should not see the project "(.*?)"$/) do |project_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
project_xpath = "//div[@id='project_#{project.id}']"
- page.should_not have_xpath(project_xpath)
+ expect(page).to_not have_xpath(project_xpath)
end
Then /^the project "([^"]*)" should be above the project "([^"]*)"$/ do |project_high, project_low|
- project_list_find_index(project_high).should < project_list_find_index(project_low)
+ expect(project_list_find_index(project_high)).to be < project_list_find_index(project_low)
end
Then /^the project "([^"]*)" should not be in state list "([^"]*)"$/ do |project_name, state_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
list_id = @source_view=="review" ? "list-#{state}-projects" : "list-#{state_name}-projects-container"
xpath = "//div[@id='#{list_id}']//div[@id='project_#{project.id}']"
- page.should_not have_xpath(xpath)
+ expect(page).to_not have_xpath(xpath)
end
Then /^the project "([^"]*)" should be in state list "([^"]*)"$/ do |project_name, state_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
list_id = @source_view=="review" ? "list-#{state_name}-projects" : "list-#{state_name}-projects-container"
xpath = "//div[@id='#{list_id}']//div[@id='project_#{project.id}']"
- page.should have_xpath(xpath)
+ expect(page).to have_xpath(xpath)
end
Then /^I see the project "([^"]*)" in the "([^"]*)" list$/ do |project_name, state_name|
@@ -110,27 +110,27 @@ Then /^I see the project "([^"]*)" in the "([^"]*)" list$/ do |project_name, sta
end
Then /^the project list badge for "([^"]*)" projects should show (\d+)$/ do |state_name, count|
- page.find(:xpath, "//span[@id='#{state_name}-projects-count']").text.should == count
+ expect(page.find(:xpath, "//span[@id='#{state_name}-projects-count']").text).to eq(count)
end
Then /^the new project form should be visible$/ do
- page.should have_css("div#project_new", :visible => true)
+ expect(page).to have_css("div#project_new", :visible => true)
end
Then /^the new project form should not be visible$/ do
- page.should_not have_css("div#project_new", :visible => true)
+ expect(page).to_not have_css("div#project_new", :visible => true)
end
Then /^the project "([^"]*)" should have (\d+) actions listed$/ do |project_name, count|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
xpath = "//div[@id='list-active-projects-container']//div[@id='project_#{project.id}']//span[@class='needsreview']"
- page.find(:xpath, xpath).text.should == "#{project.name} (#{count} actions)"
+ expect(page.find(:xpath, xpath).text).to eq("#{project.name} (#{count} actions)")
end
Then /^the project "([^"]*)" should have (\d+) deferred actions listed$/ do |project_name, deferred|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
xpath = "//div[@id='list-active-projects-container']//div[@id='project_#{project.id}']//span[@class='needsreview']"
- page.find(:xpath, xpath).text.should == "#{project.name} (#{deferred} deferred actions)"
-end
\ No newline at end of file
+ expect(page.find(:xpath, xpath).text).to eq("#{project.name} (#{deferred} deferred actions)")
+end
diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb
index 8ce96f81..2e177e5e 100644
--- a/features/step_definitions/project_steps.rb
+++ b/features/step_definitions/project_steps.rb
@@ -42,7 +42,7 @@ end
Given /^there exists a project (?:|called )"([^"]*)" for user "([^"]*)"$/ do |project_name, user_name|
user = User.where(:login => user_name).first
- user.should_not be_nil
+ expect(user).to_not be_nil
@project = user.projects.create!(:name => project_name)
# acts_as_list adds at top by default, but that is counter-intuitive when reading scenario's, so reverse this
@project.move_to_bottom
@@ -73,7 +73,7 @@ Given /^I have a (completed|hidden) project called "([^"]*)"$/ do |state, projec
step "I have a project called \"#{project_name}\""
@project.send(state=="completed" ? "complete!" : "hide!")
@project.reload
- @project.send(state=="completed" ? "completed?" : "hidden?").should be_true
+ expect(@project.send(state=="completed" ? "completed?" : "hidden?")).to be_true
end
Given /^I have (\d+) completed projects$/ do |number_of_projects|
@@ -102,7 +102,7 @@ end
Given /^the default tags for "(.*?)" are "(.*?)"$/ do |project_name, default_tags|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
project.default_tags = default_tags
project.save!
@@ -110,12 +110,12 @@ end
When /^I open the project edit form$/ do
click_link "link_edit_project_#{@project.id}"
- page.should have_css("button#submit_project_#{@project.id}", :visible => true)
+ expect(page).to have_css("button#submit_project_#{@project.id}", :visible => true)
end
When /^I cancel the project edit form$/ do
click_link "cancel_project_#{@project.id}"
- page.should_not have_css("submit_project_#{@project.id}")
+ expect(page).to_not have_css("submit_project_#{@project.id}")
wait_for_animations_to_end
end
@@ -147,13 +147,13 @@ end
When /^I edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_current_name, project_new_name|
@project = @current_user.projects.where(:name => project_current_name).first
- @project.should_not be_nil
+ expect(@project).to_not be_nil
step "I edit the project name to \"#{project_new_name}\""
end
When /^I try to edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_current_name, project_new_name|
@project = @current_user.projects.where(:name => project_current_name).first
- @project.should_not be_nil
+ expect(@project).to_not be_nil
step "I try to edit the project name to \"#{project_new_name}\""
end
@@ -168,14 +168,14 @@ When /^I click to edit the project name in place$/ do
end
When /^I edit the project settings$/ do
- @project.should_not be_nil
+ expect(@project).to_not be_nil
click_link "link_edit_project_#{@project.id}"
- page.should have_xpath("//div[@id='edit_project_#{@project.id}']/form//button[@id='submit_project_#{@project.id}']")
+ expect(page).to have_xpath("//div[@id='edit_project_#{@project.id}']/form//button[@id='submit_project_#{@project.id}']")
end
When /^I close the project settings$/ do
- @project.should_not be_nil
+ expect(@project).to_not be_nil
click_link "Cancel"
wait_for_ajax
wait_for_animations_to_end
@@ -183,7 +183,7 @@ end
When /^I edit the project state of "([^"]*)" to "([^"]*)"$/ do |project_name, state_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
edit_project_settings(project) do
choose "project_state_#{state_name}"
@@ -192,7 +192,7 @@ end
When /^I edit project "([^"]*)" and mark the project as reviewed$/ do |project_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
open_project_edit_form(project)
click_link "reviewed_project_#{project.id}"
@@ -207,11 +207,11 @@ When /^I add a note "([^"]*)" to the project$/ do |note_body|
submit_button = "div.widgets button#submit_note"
click_link "Add a note"
- page.should have_css submit_button
+ expect(page).to have_css submit_button
fill_in "note[body]", :with => note_body
elem = find(submit_button)
- elem.should_not be_nil
+ expect(elem).to_not be_nil
elem.click
wait_until do
@@ -221,9 +221,9 @@ When /^I add a note "([^"]*)" to the project$/ do |note_body|
end
When /^I click on the first note icon$/ do
- @project.should_not be_nil
+ expect(@project).to_not be_nil
@note = @project.notes.first # assume first note is also first on screen
- @note.should_not be_nil
+ expect(@note).to_not be_nil
click_link "link_note_#{@note.id}"
end
@@ -242,44 +242,44 @@ end
Then /^I should be able to change the project name in place$/ do
# Note that this is not changing the project name
- page.should have_css("span#project_name>form>input")
+ expect(page).to have_css("span#project_name>form>input")
page.find("span#project_name > form > button[type=cancel]").click
- page.should_not have_css("span#project_name>form>input")
+ expect(page).to_not have_css("span#project_name>form>input")
end
Then /^I should not be able to change the project name in place$/ do
step "I click to edit the project name in place"
- page.should_not have_xpath("//span[@id='project_name']/form/input")
+ expect(page).to_not have_xpath("//span[@id='project_name']/form/input")
end
Then /^the form for adding a note should not be visible$/ do
- page.should_not have_css("edit_form_note")
+ expect(page).to_not have_css("edit_form_note")
end
Then /^I should go to that note page$/ do
current_path = URI.parse(current_url).path
note_path = note_path(@note)
- current_path.should == note_path
+ expect(current_path).to eq(note_path)
end
Then /^I should see one note in the project$/ do
- page.should have_xpath("//div[@class='note_wrapper']")
+ expect(page).to have_xpath("//div[@class='note_wrapper']")
end
Then /^I should see the bold text "([^\"]*)" in the project description$/ do |text_in_bold|
xpath="//div[@class='project_description']/p/strong"
- page.should have_xpath(xpath)
+ expect(page).to have_xpath(xpath)
bold_text = page.find(:xpath, xpath).text
- bold_text.should =~ /#{text_in_bold}/
+ expect(bold_text).to match(/#{text_in_bold}/)
end
Then /^I should see the italic text "([^\"]*)" in the project description$/ do |text_in_italic|
xpath="//div[@class='project_description']/p/em"
- page.should have_xpath(xpath)
+ expect(page).to have_xpath(xpath)
italic_text = page.find(:xpath, xpath).text
- italic_text.should =~ /#{text_in_italic}/
+ expect(italic_text).to match(/#{text_in_italic}/)
end
Then /^the project title should be "(.*)"$/ do |title|
@@ -295,24 +295,24 @@ end
Then /^I should (see|not see) the default project settings$/ do |visible|
default_settings = "This project is active with no default context and with no default tags"
- page.should have_css("div.project_settings")
+ expect(page).to have_css("div.project_settings")
elem = page.find("div.project_settings")
if visible == "see"
- elem.should be_visible
- elem.text.should =~ /#{default_settings}/
+ expect(elem).to be_visible
+ expect(elem.text).to match(/#{default_settings}/)
else
- elem.should_not be_visible
+ expect(elem).to_not be_visible
end
end
Then /^I should have a project called "([^"]*)"$/ do |project_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
end
Then /^I should have (\d+) todo in project "([^"]*)"$/ do |todo_count, project_name|
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
- project.todos.count.should == todo_count.to_i
+ expect(project).to_not be_nil
+ expect(project.todos.count).to eq(todo_count.to_i)
end
diff --git a/features/step_definitions/recurring_todo_steps.rb b/features/step_definitions/recurring_todo_steps.rb
index 44e76cea..e1c5535e 100644
--- a/features/step_definitions/recurring_todo_steps.rb
+++ b/features/step_definitions/recurring_todo_steps.rb
@@ -14,7 +14,7 @@ Given /^I have a repeat pattern called "([^"]*)"$/ do |pattern_name|
:created_at => Time.now - 1.day,
:completed_at => nil
)
- @recurring_todo.completed?.should be_false
+ expect(@recurring_todo.completed?).to be_false
@todo = @current_user.todos.create!(
:description => pattern_name,
:context_id => context.id,
@@ -24,7 +24,7 @@ end
Given /^I have a completed repeat pattern "([^"]*)"$/ do |pattern_name|
step "I have a repeat pattern called \"#{pattern_name}\""
@recurring_todo.toggle_completion!
- @recurring_todo.completed?.should be_true
+ expect(@recurring_todo.completed?).to be_true
end
Given /^I have (\d+) completed repeat patterns$/ do |number_of_patterns|
@@ -39,39 +39,39 @@ end
When /^I edit the name of the pattern "([^\"]*)" to "([^\"]*)"$/ do |pattern_name, new_name|
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
- pattern.should_not be_nil
+ expect(pattern).to_not be_nil
click_link "link_edit_recurring_todo_#{pattern.id}"
- page.should have_css("input#edit_recurring_todo_description")
+ expect(page).to have_css("input#edit_recurring_todo_description")
fill_in "edit_recurring_todo_description", :with => new_name
page.find("button#recurring_todo_edit_update_button").click
- page.should_not have_css("div#edit-recurring-todo", :visible => true)
+ expect(page).to_not have_css("div#edit-recurring-todo", :visible => true)
end
When /^I star the pattern "([^\"]*)"$/ do |pattern_name|
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
- pattern.should_not be_nil
+ expect(pattern).to_not be_nil
click_link "star_icon_#{pattern.id}"
end
When /^I delete the pattern "([^"]*)"$/ do |pattern_name|
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
- pattern.should_not be_nil
+ expect(pattern).to_not be_nil
handle_js_confirm do
click_link "delete_icon_#{pattern.id}"
end
- get_confirm_text.should == "Are you sure that you want to delete the recurring action '#{pattern_name}'?"
+ expect(get_confirm_text).to eq("Are you sure that you want to delete the recurring action '#{pattern_name}'?")
- page.should_not have_css("#delete_icon_#{pattern.id}")
+ expect(page).to_not have_css("#delete_icon_#{pattern.id}")
end
When /^I mark the pattern "([^"]*)" as (complete|active)$/ do |pattern_name, state|
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
- pattern.should_not be_nil
- pattern.completed?.should(state=="complete" ? be_false : be_true)
+ expect(pattern).to_not be_nil
+ expect(pattern.completed?).to (state=="complete" ? be_false : be_true)
page.find("#check_#{pattern.id}").click
wait_for_ajax
wait_for_animations_to_end
@@ -79,7 +79,7 @@ end
When /^I follow the recurring todo link of "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
page.find(:xpath, "//div[@id='todo_#{todo.id}']//a[@class='recurring_icon']/img").click
sleep 1 # wait for page to load
@@ -89,21 +89,21 @@ Then /^the state list "([^"]*)" should be empty$/ do |state|
empty_id = "recurring-todos-empty-nd" if state.downcase == "active"
empty_id = "completed-empty-nd" if state.downcase == "completed"
empty_msg = page.find("div##{empty_id}")
- empty_msg.visible?.should be_true
+ expect(empty_msg.visible?).to be_true
end
Then /^the pattern "([^\"]*)" should be starred$/ do |pattern_name|
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
- pattern.should_not be_nil
- page.should have_xpath("//div[@id='recurring_todo_#{pattern.id}']//img[@class='todo_star starred']")
+ expect(pattern).to_not be_nil
+ expect(page).to have_xpath("//div[@id='recurring_todo_#{pattern.id}']//img[@class='todo_star starred']")
end
Then /^I should see the form for "([^\"]*)" recurrence pattern$/ do |recurrence_period|
- page.should have_css("#recurring_#{recurrence_period.downcase}", :visible => true)
+ expect(page).to have_css("#recurring_#{recurrence_period.downcase}", :visible => true)
end
Then /^the pattern "([^"]*)" should be in the state list "([^"]*)"$/ do |pattern_name, state_name|
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
- pattern.should_not be_nil
- page.should have_xpath("//div[@id='#{state_name}_recurring_todos_container']//div[@id='recurring_todo_#{pattern.id}']")
+ expect(pattern).to_not be_nil
+ expect(page).to have_xpath("//div[@id='#{state_name}_recurring_todos_container']//div[@id='recurring_todo_#{pattern.id}']")
end
diff --git a/features/step_definitions/shared_new_todo_steps.rb b/features/step_definitions/shared_new_todo_steps.rb
index 612c579e..6b19c970 100644
--- a/features/step_definitions/shared_new_todo_steps.rb
+++ b/features/step_definitions/shared_new_todo_steps.rb
@@ -1,15 +1,15 @@
Then /^the single action form should be visible$/ do
- page.should have_css("#todo_new_action", :visible => true)
+ expect(page).to have_css("#todo_new_action", :visible => true)
end
Then /^the single action form should not be visible$/ do
- page.should_not have_css("#todo_new_action", :visible=>true)
+ expect(page).to_not have_css("#todo_new_action", :visible=>true)
end
Then /^the multiple action form should be visible$/ do
- page.should have_css("#todo_multi_add", :visible => true)
+ expect(page).to have_css("#todo_multi_add", :visible => true)
end
Then /^the multiple action form should not be visible$/ do
- page.should_not have_css("#todo_multi_add", :visible=>true)
+ expect(page).to_not have_css("#todo_multi_add", :visible=>true)
end
\ No newline at end of file
diff --git a/features/step_definitions/stats_steps.rb b/features/step_definitions/stats_steps.rb
index 619ebf6d..53c60028 100644
--- a/features/step_definitions/stats_steps.rb
+++ b/features/step_definitions/stats_steps.rb
@@ -4,7 +4,7 @@ When /^I click on the chart for actions done in the last 12 months$/ do
end
Then /^I should see a chart$/ do
- page.should have_css("div.open-flash-chart")
+ expect(page).to have_css("div.open-flash-chart")
end
When /^I click on the chart for running time of all incomplete actions$/ do
diff --git a/features/step_definitions/todo_create_steps.rb b/features/step_definitions/todo_create_steps.rb
index cf782492..9eaf5c38 100644
--- a/features/step_definitions/todo_create_steps.rb
+++ b/features/step_definitions/todo_create_steps.rb
@@ -17,7 +17,7 @@ Given(/^I have a todo "([^"]*)" in the context "([^"]*)" in the project "([^"]*)
step "I have a todo \"#{description}\" in the context \"#{context_name}\""
@project = @current_user.projects.where(:name => project_name).first_or_create
- @project.should_not be_nil
+ expect(@project).to_not be_nil
@todo.project = @project
@todo.save!
@@ -189,7 +189,7 @@ end
Given /^I have a project "([^"]*)" that has the following (todos|deferred todos)$/ do |project_name, kind_of_todo, todos|
step "I have a project called \"#{project_name}\""
- @project.should_not be_nil
+ expect(@project).to_not be_nil
todos.hashes.each do |todo|
new_todo = @current_user.todos.create!(
@@ -242,7 +242,7 @@ When /^I submit a new action with description "([^"]*)" with a dependency on "([
click_first_line_of_auto_complete
new_dependency_line = "//li[@id='pred_#{predecessor.id}']"
- page.should have_xpath(new_dependency_line, :visible => true)
+ expect(page).to have_xpath(new_dependency_line, :visible => true)
submit_next_action_form
end
diff --git a/features/step_definitions/todo_edit_steps.rb b/features/step_definitions/todo_edit_steps.rb
index 860ba241..ad8c91f9 100644
--- a/features/step_definitions/todo_edit_steps.rb
+++ b/features/step_definitions/todo_edit_steps.rb
@@ -2,7 +2,7 @@
When /^I mark "([^"]*)" as complete$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
check "mark_complete_#{todo.id}"
@@ -12,7 +12,7 @@ end
When /^I mark "([^"]*)" as uncompleted$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
uncheck "mark_complete_#{todo.id}"
@@ -30,12 +30,12 @@ end
When /^I star the action "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath_unstarred = "//div[@id='line_todo_#{todo.id}']//img[@class='todo_star']"
xpath_starred = "//div[@id='line_todo_#{todo.id}']//img[@class='todo_star starred']"
- page.should have_xpath(xpath_unstarred)
+ expect(page).to have_xpath(xpath_unstarred)
star_img = "//img[@id='star_img_#{todo.id}']"
page.find(:xpath, star_img).click
@@ -43,22 +43,22 @@ When /^I star the action "([^"]*)"$/ do |action_description|
wait_for_ajax
wait_for_animations_to_end
- page.should have_xpath(xpath_starred)
+ expect(page).to have_xpath(xpath_starred)
end
When /^I unstar the action "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath_unstarred = "//div[@id='line_todo_#{todo.id}']//img[@class='todo_star']"
xpath_starred = "//div[@id='line_todo_#{todo.id}']//img[@class='todo_star starred']"
- page.should have_xpath(xpath_starred)
+ expect(page).to have_xpath(xpath_starred)
star_img = "//img[@id='star_img_#{todo.id}']"
page.find(:xpath, star_img).click
- page.should have_xpath(xpath_unstarred)
+ expect(page).to have_xpath(xpath_unstarred)
end
####### Editing a todo using Edit Form #######
@@ -87,7 +87,7 @@ end
When /^I edit the description of "([^"]*)" to "([^"]*)"$/ do |action_description, new_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
within "form.edit_todo_form" do
@@ -98,7 +98,7 @@ end
When /^I try to edit the description of "([^"]*)" to "([^"]*)"$/ do |action_description, new_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
within "form.edit_todo_form" do
@@ -112,7 +112,7 @@ end
When /^I edit the due date of "([^"]*)" to "([^"]*)"$/ do |action_description, date|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
fill_in "due_todo_#{todo.id}", :with => date
@@ -131,7 +131,7 @@ end
When /^I clear the due date of "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
# use all()[0] to get the first todo. This is for calendar page where you can have
@@ -147,7 +147,7 @@ end
When /^I edit the show from date of "([^"]*)" to next month$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
fill_in "show_from_todo_#{todo.id}", :with => format_date(todo.created_at + 1.month)
@@ -156,7 +156,7 @@ end
When /^I remove the show from date from "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
page.find(:xpath, "//div[@id='edit_todo_#{todo.id}']//a[@id='show_from_x_todo_#{todo.id}']/img").click
@@ -169,7 +169,7 @@ end
When /^I defer "([^"]*)" for 1 day$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_submenu_for(todo) do
click_link "defer_1_todo_#{todo.id}"
@@ -181,7 +181,7 @@ end
When /^I edit the tags of "([^"]*)" to "([^"]*)"$/ do |action_description, tags|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_edit_form_for(todo)
within "form#form_todo_#{todo.id}" do
@@ -192,13 +192,13 @@ end
When /^I make a project of "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
open_submenu_for(todo) do
click_link "to_project_todo_#{todo.id}"
end
- page.should have_no_css("div#line_todo_#{todo.id}")
+ expect(page).to have_no_css("div#line_todo_#{todo.id}")
wait_for_ajax
wait_for_animations_to_end
end
@@ -207,5 +207,5 @@ end
Then /^I should see an error message$/ do
error_block = "//form/div[@id='edit_error_status']"
- page.should have_xpath(error_block)
+ expect(page).to have_xpath(error_block)
end
\ No newline at end of file
diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb
index a574d6d2..6bb11532 100644
--- a/features/step_definitions/todo_steps.rb
+++ b/features/step_definitions/todo_steps.rb
@@ -12,7 +12,7 @@ When /^I delete the action "([^"]*)"$/ do |action_description|
click_link "delete_todo_#{todo.id}"
end
end
- get_confirm_text.should == "Are you sure that you want to delete the action '#{todo.description}'?"
+ expect(get_confirm_text).to eq("Are you sure that you want to delete the action '#{todo.description}'?")
wait_for_ajax
end
@@ -25,130 +25,130 @@ end
When /^I open the notes of "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
page.find(:xpath, "//div[@id='line_todo_#{todo.id}']/div/a/img").click
- page.should have_xpath("//div[@id='notes_todo_#{todo.id}']", :visible=>true)
+ expect(page).to have_xpath("//div[@id='notes_todo_#{todo.id}']", :visible=>true)
end
####### THEN #######
Then /^I should see a starred "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath_starred = "//div[@id='line_todo_#{todo.id}']//img[@class='todo_star starred']"
- page.should have_xpath(xpath_starred)
+ expect(page).to have_xpath(xpath_starred)
end
Then /^I should see an unstarred "([^"]*)"$/ do |action_description|
todo = @current_user.todos.where(:description => action_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath_starred = "//div[@id='line_todo_#{todo.id}']//img[@class='todo_star']"
- page.should have_xpath(xpath_starred)
+ expect(page).to have_xpath(xpath_starred)
end
Then /^I should see ([0-9]+) todos$/ do |count|
total = page.all("div.item-container").inject(0) { |s, e| s+=1 }
- total.should == count.to_i
+ expect(total).to eq(count.to_i)
end
Then /^I should see the todo "([^\"]*)"$/ do |todo_description|
- page.should have_xpath("//span[.=\"#{todo_description}\"]", :visible => true)
+ expect(page).to have_xpath("//span[.=\"#{todo_description}\"]", :visible => true)
end
Then /^I should not see the todo "([^\"]*)"$/ do |todo_description|
- page.should_not have_xpath("//span[.=\"#{todo_description}\"]", :visible => true)
+ expect(page).to_not have_xpath("//span[.=\"#{todo_description}\"]", :visible => true)
end
Then /^I should see a completed todo "([^"]*)"$/ do |todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
# only completed todos have a grey span with the completed_at date
xpath = "//div[@id='line_todo_#{todo.id}']/div/span[@class='grey']"
- page.should have_xpath(xpath, :visible=>true)
+ expect(page).to have_xpath(xpath, :visible=>true)
end
Then /^I should see an active todo "([^"]*)"$/ do |todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath = "//div[@id='line_todo_#{todo.id}']/img[@class='grip']"
- page.should have_xpath(xpath, :visible=>true)
+ expect(page).to have_xpath(xpath, :visible=>true)
end
Then /^the number of actions should be (\d+)$/ do |count|
- @current_user.todos.count.should == count.to_i
+ expect(@current_user.todos.count).to eq(count.to_i)
end
Then /^a confirmation for adding a new context "([^"]*)" should be asked$/ do |context_name|
- get_confirm_text.should == "New context '#{context_name}' will be also created. Are you sure?"
+ expect(get_confirm_text).to eq("New context '#{context_name}' will be also created. Are you sure?")
end
Then /^the selected project should be "([^"]*)"$/ do |content|
# Works for mobile. TODO: make it work for both mobile and non-mobile
if content.blank?
- page.has_css?("select#todo_project_id option[selected='selected']").should be_false
+ expect(page.has_css?("select#todo_project_id option[selected='selected']")).to be_false
else
- page.find("select#todo_project_id option[selected='selected']").text.should =~ /#{content}/
+ expect(page.find("select#todo_project_id option[selected='selected']").text).to match(/#{content}/)
end
end
Then /^the selected context should be "([^"]*)"$/ do |content|
# Works for mobile. TODO: make it work for both mobile and non-mobile
if content.blank?
- page.has_css?("select#todo_context_id option[selected='selected']").should be_false
+ expect(page.has_css?("select#todo_context_id option[selected='selected']")).to be_false
else
- page.find("select#todo_context_id option[selected='selected']").text.should =~ /#{content}/
+ expect(page.find("select#todo_context_id option[selected='selected']").text).to match(/#{content}/)
end
end
Then /^I should see the page selector$/ do
- page.should have_xpath(".//a[@class='next_page']")
+ expect(page).to have_xpath(".//a[@class='next_page']")
end
Then /^the page should be "([^"]*)"$/ do |page_number|
- page.find(:xpath, ".//div[@class='paginate_header']//em[@class='current']").text.should == page_number
+ expect(page.find(:xpath, ".//div[@class='paginate_header']//em[@class='current']").text).to eq(page_number)
end
Then /^the project field of the new todo form should contain "([^"]*)"$/ do |project_name|
xpath= "//form[@id='todo-form-new-action']/input[@id='todo_project_name']"
- project_name.should == page.find(:xpath, xpath).value
+ expect(project_name).to eq(page.find(:xpath, xpath).value)
end
Then /^the default context of the new todo form should be "([^"]*)"$/ do |context_name|
xpath= "//form[@id='todo-form-new-action']/input[@id='todo_context_name']"
- context_name.should == page.find(:xpath, xpath).value
+ expect(context_name).to eq(page.find(:xpath, xpath).value)
end
Then /^the tag field in the new todo form should be empty$/ do
xpath= "//form[@id='todo-form-new-action']/input[@id='tag_list']"
- page.find(:xpath, xpath).value.blank?.should be_true
+ expect(page.find(:xpath, xpath).value).to be_blank
end
Then /^the tag field in the new todo form should be "([^"]*)"$/ do |tag_list|
xpath= "//form[@id='todo-form-new-action']/input[@id='tag_list']"
- tag_list.should == page.find(:xpath, xpath).value
+ expect(tag_list).to eq(page.find(:xpath, xpath).value)
end
Then /^the tags of "([^"]*)" should be "([^"]*)"$/ do |todo_description, tag_list|
- find_todo(todo_description).tag_list.should == tag_list
+ expect(find_todo(todo_description).tag_list).to eq(tag_list)
end
Then /^I should see "([^"]*)" in the completed section of the mobile site$/ do |desc|
todo = @current_user.todos.where(:description => desc).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
xpath = "//div[@id='completed_container']//a[@href='/todos/#{todo.id}.m']"
- page.should have_xpath(xpath)
+ expect(page).to have_xpath(xpath)
end
Then /^I should (see|not see) the notes of "([^"]*)"$/ do |visible, todo_description|
todo = @current_user.todos.where(:description => todo_description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
page.find("div#notes_todo_#{todo.id}").send(visible=="see" ? "should" : "should_not", be_visible)
end
diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb
index 335b5e4c..80bb7b63 100644
--- a/features/step_definitions/user_steps.rb
+++ b/features/step_definitions/user_steps.rb
@@ -19,13 +19,13 @@ Given /^the following user records with hash algorithm$/ do |table|
when 'bcrypt'
user.change_password( password, password )
user.reload
- BCrypt::Password.new(user.crypted_password).should == password
+ expect(BCrypt::Password.new(user.crypted_password)).to eq(password)
when 'sha1'
user.password = user.password_confirmation = nil
user.send(:write_attribute, :crypted_password, user.sha1(password))
user.save
user.reload
- user.crypted_password.should == user.sha1(password)
+ expect(user.crypted_password).to eq(user.sha1(password))
else
raise "Unknown hashing algorithm: #{algorithm}"
end
@@ -49,14 +49,14 @@ When /^I delete the user "([^\"]*)"$/ do |username|
# click "//tr[@id='user-3']//img"
# assert_confirmation "Warning: this will delete user 'john', all their actions, contexts, project and notes. Are you sure that you want to continue?"
user = User.where(:login => username).first
- user.should_not be_nil
+ expect(user).to_not be_nil
handle_js_confirm do
page.find(:xpath, "//tr[@id='user-#{user.id}']//img").click
end
- get_confirm_text.should == "Warning: this will delete user '#{user.login}', all their actions, contexts, project and notes. Are you sure that you want to continue?"
+ expect(get_confirm_text).to eq("Warning: this will delete user '#{user.login}', all their actions, contexts, project and notes. Are you sure that you want to continue?")
- page.should_not have_css("tr#user-#{user.id}")
+ expect(page).to_not have_css("tr#user-#{user.id}")
end
Then /^I should see that a user named "([^\"]*)" is not present$/ do |username|
diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb
index 0f0af8aa..69470a2f 100644
--- a/features/step_definitions/web_steps.rb
+++ b/features/step_definitions/web_steps.rb
@@ -101,48 +101,32 @@ Then /^(?:|I )should see JSON:$/ do |expected_json|
require 'json'
expected = JSON.pretty_generate(JSON.parse(expected_json))
actual = JSON.pretty_generate(JSON.parse(response.body))
- expected.should == actual
+ expect(expected).to eq(actual)
end
Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
with_scope(selector) do
- if page.respond_to? :should
- page.should have_content(text)
- else
- assert page.has_content?(text)
- end
+ expect(page).to have_content(text)
end
end
Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
regexp = Regexp.new(regexp)
with_scope(selector) do
- if page.respond_to? :should
- page.should have_xpath('//*', :text => regexp)
- else
- assert page.has_xpath?('//*', :text => regexp)
- end
+ expect(page).to have_xpath('//*', :text => regexp)
end
end
Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
with_scope(selector) do
- if page.respond_to? :should
- page.should have_no_content(text)
- else
- assert page.has_no_content?(text)
- end
+ expect(page).to have_no_content(text)
end
end
Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
regexp = Regexp.new(regexp)
with_scope(selector) do
- if page.respond_to? :should
- page.should have_no_xpath('//*', :text => regexp)
- else
- assert page.has_no_xpath?('//*', :text => regexp)
- end
+ expect(page).to have_no_xpath('//*', :text => regexp)
end
end
@@ -150,11 +134,7 @@ Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |
with_scope(selector) do
field = find_field(field)
field_value = (field.tag_name == 'textarea') ? field.text : field.value
- if field_value.respond_to? :should
- field_value.should =~ /#{value}/
- else
- assert_match(/#{value}/, field_value)
- end
+ expect(field_value).to match(/#{value}/)
end
end
@@ -162,43 +142,27 @@ Then /^the "([^"]*)" field(?: within "([^"]*)")? should not contain "([^"]*)"$/
with_scope(selector) do
field = find_field(field)
field_value = (field.tag_name == 'textarea') ? field.text : field.value
- if field_value.respond_to? :should_not
- field_value.should_not =~ /#{value}/
- else
- assert_no_match(/#{value}/, field_value)
- end
+ expect(field_value).to_not match(/#{value}/)
end
end
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector|
with_scope(selector) do
field_checked = find_field(label)['checked']
- if field_checked.respond_to? :should
- field_checked.should be_true
- else
- assert field_checked
- end
+ expect(field_checked).to be_true
end
end
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector|
with_scope(selector) do
field_checked = find_field(label)['checked']
- if field_checked.respond_to? :should
- field_checked.should be_false
- else
- assert !field_checked
- end
+ expect(field_checked).to be_false
end
end
Then /^(?:|I )should be on (.+)$/ do |page_name|
current_path = URI.parse(current_url).path
- if current_path.respond_to? :should
- current_path.should == path_to(page_name)
- else
- assert_equal path_to(page_name), current_path
- end
+ expect(current_path).to eq(path_to(page_name))
end
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
@@ -207,11 +171,7 @@ Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
expected_params = {}
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
- if actual_params.respond_to? :should
- actual_params.should == expected_params
- else
- assert_equal expected_params, actual_params
- end
+ expect(actual_params).to eq(expected_params)
end
Then /^show me the page$/ do
diff --git a/features/support/tracks_form_helper.rb b/features/support/tracks_form_helper.rb
index 6fd06d79..d7805ffb 100644
--- a/features/support/tracks_form_helper.rb
+++ b/features/support/tracks_form_helper.rb
@@ -4,7 +4,7 @@ module TracksFormHelper
edit_link = "div#line_todo_#{todo.id} a#icon_edit_todo_#{todo.id}"
# make sure we can open the edit form
- page.should have_css(edit_link)
+ expect(page).to have_css(edit_link)
# on calendar page there can be more than 1 occurance of a todo, so we select the first here
all(:css, edit_link)[0].click
@@ -17,7 +17,7 @@ module TracksFormHelper
page.find("a#link_edit_context_#{context.id}").click
# wait for the form to appear (which included a submit button)
- page.should have_css("button#submit_context_#{context.id}", :visible=>true)
+ expect(page).to have_css("button#submit_context_#{context.id}", :visible=>true)
end
def submit_form(form_xpath, button_name)
@@ -53,23 +53,23 @@ module TracksFormHelper
end
def wait_for_todo_form_to_go_away(todo)
- page.should_not have_content("button#submit_todo_#{todo.id}")
+ expect(page).to_not have_content("button#submit_todo_#{todo.id}")
end
def wait_for_context_form_to_appear(context)
- page.should have_css("button#submit_context_#{context.id}", :visible=>true)
+ expect(page).to have_css("button#submit_context_#{context.id}", :visible=>true)
end
def wait_for_context_form_to_go_away(context)
# wait for the form to go away
- page.should_not have_css("button#submit_context_#{context.id}", :visible => true)
+ expect(page).to_not have_css("button#submit_context_#{context.id}", :visible => true)
# wait for the changed context to appear
- page.should have_css("a#link_edit_context_#{context.id}", :visible=> true)
+ expect(page).to have_css("a#link_edit_context_#{context.id}", :visible=> true)
end
def open_project_edit_form(project)
click_link "link_edit_project_#{project.id}"
- page.should have_css("button#submit_project_#{project.id}")
+ expect(page).to have_css("button#submit_project_#{project.id}")
end
def submit_project_edit_form(project)
@@ -92,7 +92,7 @@ module TracksFormHelper
wait_for_ajax
wait_for_animations_to_end
- page.should_not have_css("button#submit_project_#{project.id}", :visible => true)
+ expect(page).to_not have_css("button#submit_project_#{project.id}", :visible => true)
end
def edit_project_settings(project)
diff --git a/features/support/tracks_step_helper.rb b/features/support/tracks_step_helper.rb
index 14518010..fbaddada 100644
--- a/features/support/tracks_step_helper.rb
+++ b/features/support/tracks_step_helper.rb
@@ -29,14 +29,14 @@ module TracksStepHelper
def wait_for_ajax
start_time = Time.now
- page.evaluate_script('jQuery.isReady&&jQuery.active==0').class.should_not eql(String)
+ expect(page.evaluate_script('jQuery.isReady&&jQuery.active==0').class).to_not eql(String)
until(page.evaluate_script('jQuery.isReady&&jQuery.active==0') || (start_time + 5.seconds) < Time.now)
sleep 0.05
end
end
def wait_for_auto_complete
- page.should have_css("a.ui-state-focus", :visible => true)
+ expect(page).to have_css("a.ui-state-focus", :visible => true)
end
def click_first_line_of_auto_complete
@@ -57,19 +57,19 @@ module TracksStepHelper
def find_todo(description)
todo = @current_user.todos.where(:description => description).first
- todo.should_not be_nil
+ expect(todo).to_not be_nil
return todo
end
def find_context(context_name)
context = @current_user.contexts.where(:name => context_name).first
- context.should_not be_nil
+ expect(context).to_not be_nil
return context
end
def find_project(project_name)
project = @current_user.projects.where(:name => project_name).first
- project.should_not be_nil
+ expect(project).to_not be_nil
return project
end
@@ -102,12 +102,12 @@ module TracksStepHelper
# click menu
view_menu_link = "#{view_menu} a#menu_view_link"
- page.should have_css(view_menu_link, :visible => true)
+ expect(page).to have_css(view_menu_link, :visible => true)
page.find(view_menu_link).click
# wait for menu to be visible
view_menu_item = "#{view_menu} li#menu_view_toggle_contexts"
- page.should have_css(view_menu_item)
+ expect(page).to have_css(view_menu_item)
within view_menu do
yield
@@ -118,7 +118,7 @@ module TracksStepHelper
wait_for_animations_to_end
submenu_arrow = "div#line_todo_#{todo.id} img.todo-submenu"
- page.should have_css(submenu_arrow, :visible=>true)
+ expect(page).to have_css(submenu_arrow, :visible=>true)
arrow = page.find(submenu_arrow, :match => :first)
arrow.click
@@ -148,4 +148,4 @@ module TracksStepHelper
page.execute_script(js)
end
-end
\ No newline at end of file
+end
From 622291d98d7ad586e22a4637d0e9670ae532ddac Mon Sep 17 00:00:00 2001
From: Dan Rice
Date: Thu, 12 Jun 2014 21:24:31 -0400
Subject: [PATCH 45/55] Purge UserTime from app/*
---
app/helpers/application_helper.rb | 2 +-
app/models/preference.rb | 4 ++--
app/models/project.rb | 3 +--
app/models/todo.rb | 2 +-
app/models/user.rb | 4 ++--
app/views/recurring_todos/_recurring_todo_form.html.erb | 2 +-
app/views/todos/_edit_form.m.erb | 5 ++---
7 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f4238999..07c95e87 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -29,7 +29,7 @@ module ApplicationHelper
end
def days_from_today(date)
- (date.in_time_zone.to_date - UserTime.new(current_user).date).to_i
+ (date.in_time_zone.to_date - Date.current).to_i
end
# Check due date in comparison to today's date Flag up date appropriately with
diff --git a/app/models/preference.rb b/app/models/preference.rb
index e0150cd8..c4ccb5f1 100644
--- a/app/models/preference.rb
+++ b/app/models/preference.rb
@@ -15,13 +15,13 @@ class Preference < ActiveRecord::Base
date = nil
if s.is_a?(Time)
- date = s.in_time_zone(time_zone).to_date
+ date = s.to_date
elsif s.is_a?(String)
date = Date.strptime(s, date_format)
else
raise ArgumentError.new("Bad argument type:#{s.class}")
end
- UserTime.new(user).midnight(date)
+ date.in_time_zone(time_zone).beginning_of_day
end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index c59f8bd9..913b8127 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -101,9 +101,8 @@ class Project < ActiveRecord::Base
end
def needs_review?(user)
- current_time = UserTime.new(user).time
return active? && ( last_reviewed.nil? ||
- (last_reviewed < current_time - user.prefs.review_period.days))
+ (last_reviewed < Time.current - user.prefs.review_period.days))
end
def blocked?
diff --git a/app/models/todo.rb b/app/models/todo.rb
index d91d8ee1..f9c1fa47 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -264,7 +264,7 @@ class Todo < ActiveRecord::Base
activate
else
# parse Date objects into the proper timezone
- date = UserTime.new(user).midnight(date) if (date.is_a? Date)
+ date = date.in_time_zone.beginning_of_day if (date.is_a? Date)
# show_from needs to be set before state_change because of "bug" in aasm.
# If show_from is not set, the todo will not validate and thus aasm will not save
diff --git a/app/models/user.rb b/app/models/user.rb
index 4fb1ca29..f93ccfac 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -90,7 +90,7 @@ class User < ActiveRecord::Base
order('show_from ASC, todos.created_at DESC')},
:class_name => 'Todo') do
def find_and_activate_ready
- where('show_from <= ?', Time.zone.now).collect { |t| t.activate! }
+ where('show_from <= ?', Time.current).collect { |t| t.activate! }
end
end
@@ -160,7 +160,7 @@ class User < ActiveRecord::Base
end
def date
- UserTime.new(self).midnight(Time.now)
+ Date.current
end
def generate_token
diff --git a/app/views/recurring_todos/_recurring_todo_form.html.erb b/app/views/recurring_todos/_recurring_todo_form.html.erb
index 2ad9ac63..124caf96 100644
--- a/app/views/recurring_todos/_recurring_todo_form.html.erb
+++ b/app/views/recurring_todos/_recurring_todo_form.html.erb
@@ -30,7 +30,7 @@