From svn at explainpmt.com Sun Jan 1 13:55:28 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Sun, 1 Jan 2006 18:55:28 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [135] more test fixture refactoring Message-ID: <20060101185528.AE082C9474@thurlow.textdrive.com> Revision: 135 Author: jwilger Date: 2006-01-01 18:55:25 +0000 (Sun, 01 Jan 2006) Log Message: ----------- more test fixture refactoring Modified Paths: -------------- trunk/db/schema.rb trunk/test/fixtures/projects_users.yml trunk/test/fixtures/users.yml trunk/test/functional/dashboard_controller_test.rb Modified: trunk/db/schema.rb =================================================================== --- trunk/db/schema.rb 2005-12-31 20:14:28 UTC (rev 134) +++ trunk/db/schema.rb 2006-01-01 18:55:25 UTC (rev 135) @@ -1,61 +1,61 @@ -# This file is autogenerated. Instead of editing this file, please use the -# migrations feature of ActiveRecord to incrementally modify your database, and -# then regenerate this schema definition. - -ActiveRecord::Schema.define(:version => 1) do - - create_table "iterations", :force => true do |t| - t.column "project_id", :integer, :default => 0, :null => false - t.column "start_date", :date - t.column "length", :integer, :default => 14 - t.column "budget", :integer - t.column "created_at", :datetime - t.column "updated_at", :datetime - end - - create_table "milestones", :force => true do |t| - t.column "project_id", :integer, :default => 0, :null => false - t.column "date", :date - t.column "name", :string - t.column "description", :text - t.column "created_at", :datetime - t.column "updated_at", :datetime - end - - create_table "projects", :force => true do |t| - t.column "name", :string - t.column "description", :text - t.column "created_at", :datetime - t.column "updated_at", :datetime - end - - create_table "projects_users", :id => false, :force => true do |t| - t.column "user_id", :integer, :default => 0, :null => false - t.column "project_id", :integer, :default => 0, :null => false - end - - create_table "stories", :force => true do |t| - t.column "scid", :integer, :default => 0, :null => false - t.column "project_id", :integer, :default => 0, :null => false - t.column "iteration_id", :integer - t.column "user_id", :integer - t.column "title", :string - t.column "points", :integer - t.column "status", :integer - t.column "priority", :integer - t.column "risk", :integer - t.column "description", :text - end - - create_table "users", :force => true do |t| - t.column "username", :string - t.column "password", :string - t.column "email", :string - t.column "first_name", :string - t.column "last_name", :string - t.column "admin", :boolean, :default => false - t.column "created_at", :datetime - t.column "updated_at", :datetime - end - -end +# This file is autogenerated. Instead of editing this file, please use the +# migrations feature of ActiveRecord to incrementally modify your database, and +# then regenerate this schema definition. + +ActiveRecord::Schema.define(:version => 1) do + + create_table "iterations", :force => true do |t| + t.column "project_id", :integer, :default => 0, :null => false + t.column "start_date", :date + t.column "length", :integer, :default => 14 + t.column "budget", :integer + t.column "created_at", :datetime + t.column "updated_at", :datetime + end + + create_table "milestones", :force => true do |t| + t.column "project_id", :integer, :default => 0, :null => false + t.column "date", :date + t.column "name", :string + t.column "description", :text + t.column "created_at", :datetime + t.column "updated_at", :datetime + end + + create_table "projects", :force => true do |t| + t.column "name", :string + t.column "description", :text + t.column "created_at", :datetime + t.column "updated_at", :datetime + end + + create_table "projects_users", :id => false, :force => true do |t| + t.column "user_id", :integer, :default => 0, :null => false + t.column "project_id", :integer, :default => 0, :null => false + end + + create_table "stories", :force => true do |t| + t.column "scid", :integer, :default => 0, :null => false + t.column "project_id", :integer, :default => 0, :null => false + t.column "iteration_id", :integer + t.column "user_id", :integer + t.column "title", :string + t.column "points", :integer + t.column "status", :integer + t.column "priority", :integer + t.column "risk", :integer + t.column "description", :text + end + + create_table "users", :force => true do |t| + t.column "username", :string + t.column "password", :string + t.column "email", :string + t.column "first_name", :string + t.column "last_name", :string + t.column "admin", :boolean, :default => false + t.column "created_at", :datetime + t.column "updated_at", :datetime + end + +end Modified: trunk/test/fixtures/projects_users.yml =================================================================== --- trunk/test/fixtures/projects_users.yml 2005-12-31 20:14:28 UTC (rev 134) +++ trunk/test/fixtures/projects_users.yml 2006-01-01 18:55:25 UTC (rev 135) @@ -1,3 +1,12 @@ pone_uone: project_id: 1 user_id: 1 +pone_utwo: + project_id: 1 + user_id: 2 +ptwo_utwo: + project_id: 2 + user_id: 2 +pone_uthree: + project_id: 1 + user_id: 3 Modified: trunk/test/fixtures/users.yml =================================================================== --- trunk/test/fixtures/users.yml 2005-12-31 20:14:28 UTC (rev 134) +++ trunk/test/fixtures/users.yml 2006-01-01 18:55:25 UTC (rev 135) @@ -13,4 +13,12 @@ email: 'user_one at example.com' first_name: 'User' last_name: 'One' - admin: false \ No newline at end of file + admin: false +third: + id: 3 + username: 'user_two' + password: 'user_twopassword' + email: 'user_two at example.com' + first_name: 'User' + last_name: 'Two' + admin: false Modified: trunk/test/functional/dashboard_controller_test.rb =================================================================== --- trunk/test/functional/dashboard_controller_test.rb 2005-12-31 20:14:28 UTC (rev 134) +++ trunk/test/functional/dashboard_controller_test.rb 2006-01-01 18:55:25 UTC (rev 135) @@ -5,12 +5,11 @@ class DashboardController; def rescue_action(e) raise e end; end class DashboardControllerTest < Test::Unit::TestCase + fixtures :users, :projects, :projects_users def setup - Project.destroy_all - User.destroy_all - create_common_fixtures :admin, :user_one, :project_one, :project_two - @user_one.projects << @project_one - @user_one.projects << @project_two + @admin = User.find 1 + @user_one = User.find 2 + @user_two = User.find 3 @controller = DashboardController.new @request = ActionController::TestRequest.new @@ -52,19 +51,17 @@ end def test_index_when_regular_user_on_one_project_team - @user_one.projects.clear - @user_one.projects << @project_one - @request.session[:current_user] = @user_one + @request.session[ :current_user ] = @user_two get :index assert_redirected_to :controller => 'dashboard', :action => 'index', - :project_id => @user_one.projects.first.id + :project_id => @user_two.projects.first.id end def test_index_with_project_id - get :index, 'project_id' => @project_one.id + get :index, 'project_id' => '1' assert_response :success assert_template 'project' - assert_equal @project_one, assigns(:project) + assert_equal Project.find( 1 ), assigns( :project ) end ### Regression Tests ### From svn at explainpmt.com Tue Jan 3 21:21:42 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 4 Jan 2006 02:21:42 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [136] Testing auth, no change Message-ID: <20060104022142.F37F8C9452@thurlow.textdrive.com> Revision: 136 Author: edavis Date: 2006-01-04 02:21:42 +0000 (Wed, 04 Jan 2006) Log Message: ----------- Testing auth, no change Modified Paths: -------------- trunk/README Modified: trunk/README =================================================================== --- trunk/README 2006-01-01 18:55:25 UTC (rev 135) +++ trunk/README 2006-01-04 02:21:42 UTC (rev 136) @@ -52,3 +52,4 @@ Apache or lighttpd as directed in the documentation for the Rails framework. 7. Load up the application in your browser, log in, and enjoy! + From svn at explainpmt.com Tue Jan 3 21:27:06 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 4 Jan 2006 02:27:06 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [137] r1179@Zen: eric | 2006-01-02 18:33:27 -0800 Message-ID: <20060104022706.31BD2C9446@thurlow.textdrive.com> Revision: 137 Author: edavis Date: 2006-01-04 02:27:05 +0000 (Wed, 04 Jan 2006) Log Message: ----------- r1179 at Zen: eric | 2006-01-02 18:33:27 -0800 Updated Reame to show last release and also to add RedCloth as a requirement. Modified Paths: -------------- trunk/README Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge + b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1181 Modified: trunk/README =================================================================== --- trunk/README 2006-01-04 02:21:42 UTC (rev 136) +++ trunk/README 2006-01-04 02:27:05 UTC (rev 137) @@ -1,4 +1,4 @@ -= eXPlain Project Management Tool 1.3.4 += eXPlain Project Management Tool 20051231.0 eXPlain Project Management Tool (or simply eXPlainPMT) is a web-based application that supports the eXtreme Programming development methodology @@ -27,6 +27,7 @@ * Ruby 1.8.2 or better * MySQL, PostgreSQL or SQLite and the Ruby drivers for whichever database you plan to use. +* Redcloth Version 3.0.4 or higher (gem install redcloth) == Installation @@ -37,7 +38,7 @@ GRANT privilege) to the username that the application should use when accessing the database. (Skip this step if using SQLite.) -3. Edit config/database.yml - only the production setting is required unless you +3. Edit config/database.yml.orig and save it as config/database.yml- only the production setting is required unless you wish to run the test suite and/or work in the development environment. Use the database and username from step 2. From johnwilger at gmail.com Thu Jan 5 18:57:53 2006 From: johnwilger at gmail.com (John Wilger) Date: Thu, 5 Jan 2006 18:57:53 -0500 Subject: [eXPlainPMT Developers] looking for schema In-Reply-To: <1f3be0490601051552m658b2fabobeb369a4dbf967bf@mail.gmail.com> References: <1f3be0490601051503l4d636a97yf636588bf18c127b@mail.gmail.com> <1f3be0490601051552m658b2fabobeb369a4dbf967bf@mail.gmail.com> Message-ID: On 1/5/06, Tim Morgan wrote: > I ran the rake, and examined the schema.rb file, but it was empty? Hmm. That certainly points out one shortcoming with that method. Running `rake` by itself (or any of the test tasks) will overwrite the schema.rb that's packaged in the download, because it uses that file to dump the development structure and then imports it into the test database. :-( Thanks for pointing that out -- I'll need to look at other options. For now, just pull the original schema.rb file out of the tarball and then run the import rake task. -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland From mannl at gmx.com Fri Jan 6 09:05:00 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Fri, 6 Jan 2006 15:05:00 +0100 Subject: [eXPlainPMT Developers] looking for schema In-Reply-To: References: <1f3be0490601051503l4d636a97yf636588bf18c127b@mail.gmail.com> <1f3be0490601051552m658b2fabobeb369a4dbf967bf@mail.gmail.com> Message-ID: <06968569-1326-46BF-8245-FD423DA60F4F@gmx.com> I'm not sure if I understand the issue, but I always use the first migration for the initial schema, and then just go from there. Rob On Jan 6, 2006, at 12:57 AM, John Wilger wrote: > On 1/5/06, Tim Morgan wrote: >> I ran the rake, and examined the schema.rb file, but it was empty? > > Hmm. That certainly points out one shortcoming with that method. > Running `rake` by itself (or any of the test tasks) will overwrite the > schema.rb that's packaged in the download, because it uses that file > to dump the development structure and then imports it into the test > database. :-( > > Thanks for pointing that out -- I'll need to look at other options. > For now, just pull the original schema.rb file out of the tarball and > then run the import rake task. > > -- > Regards, > John Wilger > http://johnwilger.com > > ----------- > Alice came to a fork in the road. "Which road do I take?" she asked. > "Where do you want to go?" responded the Cheshire cat. > "I don't know," Alice answered. > "Then," said the cat, "it doesn't matter." > - Lewis Carrol, Alice in Wonderland > > _______________________________________________ > Explainpmt-developers mailing list > Explainpmt-developers at rubyforge.org > http://rubyforge.org/mailman/listinfo/explainpmt-developers > From johnwilger at gmail.com Fri Jan 6 09:09:15 2006 From: johnwilger at gmail.com (John Wilger) Date: Fri, 6 Jan 2006 09:09:15 -0500 Subject: [eXPlainPMT Developers] looking for schema In-Reply-To: <06968569-1326-46BF-8245-FD423DA60F4F@gmx.com> References: <1f3be0490601051503l4d636a97yf636588bf18c127b@mail.gmail.com> <1f3be0490601051552m658b2fabobeb369a4dbf967bf@mail.gmail.com> <06968569-1326-46BF-8245-FD423DA60F4F@gmx.com> Message-ID: On 1/6/06, Robert C. Mannl wrote: > I'm not sure if I understand the issue, but I always use the first > migration for the initial schema, and then just go from there. In general, that's what I'm doing these days, but eXPlainPMT was started before migrations were part of Rails. I have a story in the backlog to work on sorting that out properly (adding the definitions of the "base" schema to migration #1) -- it just hasn't been tackled yet as there were some higher priority items to take care of first. -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland From svn at explainpmt.com Mon Jan 9 13:00:38 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Mon, 9 Jan 2006 18:00:38 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [138] The selected main menu item can now be specified manually. Message-ID: <20060109180038.2342CC9476@thurlow.textdrive.com> Revision: 138 Author: rmannl Date: 2006-01-09 18:00:33 +0000 (Mon, 09 Jan 2006) Log Message: ----------- The selected main menu item can now be specified manually. Modified Paths: -------------- trunk/app/controllers/stories_controller.rb trunk/app/helpers/application_helper.rb Modified: trunk/app/controllers/stories_controller.rb =================================================================== --- trunk/app/controllers/stories_controller.rb 2006-01-04 02:27:05 UTC (rev 137) +++ trunk/app/controllers/stories_controller.rb 2006-01-09 18:00:33 UTC (rev 138) @@ -45,6 +45,7 @@ # Displays a form for creating a new story card. def new @page_title = "Create new story card" + @selected_main_menu_link = :none if @story = @session[:new_story] @session[:new_story] = nil else @@ -57,6 +58,7 @@ # action. def create @page_title = "Create new story card" + @selected_main_menu_link = :none modify_risk_status_and_priority_params story = Story.new(@params['story']) story.project = @project Modified: trunk/app/helpers/application_helper.rb =================================================================== --- trunk/app/helpers/application_helper.rb 2006-01-04 02:27:05 UTC (rev 137) +++ trunk/app/helpers/application_helper.rb 2006-01-09 18:00:33 UTC (rev 138) @@ -114,11 +114,14 @@ # the ActionView::Helpers::UrlHelper#url_for method. If a block is given, and # the block returns an non-false value, the 'current' CSS class will be set on # the link. If no block is given, but the controller being linked to is the - # same as the current controller, the CSS class will be set to current. + # same as the current controller or the controller set in @selected_main_menu_link, + # the CSS class will also be set to current. # Otherwise, no CSS class is set. def main_menu_link(title, options) + selected_controller = @selected_main_menu_link ? + @selected_main_menu_link : controller.controller_name if (block_given? and yield) or - (!block_given? and controller.controller_name == options[:controller]) + (!block_given? and selected_controller.to_s == options[:controller].to_s) html_options = { 'class' => 'current' } else From mannl at gmx.com Mon Jan 9 13:10:38 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Mon, 9 Jan 2006 19:10:38 +0100 Subject: [eXPlainPMT Developers] [SVN commit] [138] The selected main menu item can now be specified manually. In-Reply-To: <20060109180038.2342CC9476@thurlow.textdrive.com> References: <20060109180038.2342CC9476@thurlow.textdrive.com> Message-ID: This should completed the previously rejected SC4 ("new story card form opens in same window"). Reason for rejection was: "?Backlog? link in navigation should not be underlined when on this screen." I took a rather simple approach (without trying to be lazy =) If there are any objections, and we should implement it differently, tell me :) Rob On Jan 9, 2006, at 7:00 PM, svn at explainpmt.com wrote: > Revision: 138 > Author: rmannl > Date: 2006-01-09 18:00:33 +0000 (Mon, 09 Jan 2006) > > Log Message: > ----------- > The selected main menu item can now be specified manually. > > Modified Paths: > -------------- > trunk/app/controllers/stories_controller.rb > trunk/app/helpers/application_helper.rb > Modified: trunk/app/controllers/stories_controller.rb > =================================================================== > --- trunk/app/controllers/stories_controller.rb 2006-01-04 02:27:05 > UTC (rev 137) > +++ trunk/app/controllers/stories_controller.rb 2006-01-09 18:00:33 > UTC (rev 138) > @@ -45,6 +45,7 @@ > # Displays a form for creating a new story card. > def new > @page_title = "Create new story card" > + @selected_main_menu_link = :none > if @story = @session[:new_story] > @session[:new_story] = nil > else > @@ -57,6 +58,7 @@ > # action. > def create > @page_title = "Create new story card" > + @selected_main_menu_link = :none > modify_risk_status_and_priority_params > story = Story.new(@params['story']) > story.project = @project > > Modified: trunk/app/helpers/application_helper.rb > =================================================================== > --- trunk/app/helpers/application_helper.rb 2006-01-04 02:27:05 UTC > (rev 137) > +++ trunk/app/helpers/application_helper.rb 2006-01-09 18:00:33 UTC > (rev 138) > @@ -114,11 +114,14 @@ > # the ActionView::Helpers::UrlHelper#url_for method. If a block > is given, and > # the block returns an non-false value, the 'current' CSS class > will be set on > # the link. If no block is given, but the controller being > linked to is the > - # same as the current controller, the CSS class will be set to > current. > + # same as the current controller or the controller set in > @selected_main_menu_link, > + # the CSS class will also be set to current. > # Otherwise, no CSS class is set. > def main_menu_link(title, options) > + selected_controller = @selected_main_menu_link ? > + @selected_main_menu_link : > controller.controller_name > if (block_given? and yield) or > - (!block_given? and controller.controller_name == options > [:controller]) > + (!block_given? and selected_controller.to_s == options > [:controller].to_s) > > html_options = { 'class' => 'current' } > else > > > > _______________________________________________ > Explainpmt-developers mailing list > Explainpmt-developers at rubyforge.org > http://rubyforge.org/mailman/listinfo/explainpmt-developers > From svn at explainpmt.com Mon Jan 9 15:16:28 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Mon, 9 Jan 2006 20:16:28 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [139] No menu item is selected when editing a story card Message-ID: <20060109201628.16135C949C@thurlow.textdrive.com> Revision: 139 Author: rmannl Date: 2006-01-09 20:16:25 +0000 (Mon, 09 Jan 2006) Log Message: ----------- No menu item is selected when editing a story card Modified Paths: -------------- trunk/app/controllers/stories_controller.rb Modified: trunk/app/controllers/stories_controller.rb =================================================================== --- trunk/app/controllers/stories_controller.rb 2006-01-09 18:00:33 UTC (rev 138) +++ trunk/app/controllers/stories_controller.rb 2006-01-09 20:16:25 UTC (rev 139) @@ -77,6 +77,7 @@ # Displays the form for editing a story card's information. def edit @page_title = "Edit story card" + @selected_main_menu_link = :none @session[:return_to] = request.env['HTTP_REFERER'] if @story = @session[:edit_story] @@ -90,6 +91,7 @@ # Updates a story card with the information posted form the #edit action. def update @page_title = "Edit story card" + @selected_main_menu_link = :none modify_risk_status_and_priority_params story = Story.find(@params['id']) story.attributes = @params['story'] From mannl at gmx.com Mon Jan 9 15:32:08 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Mon, 9 Jan 2006 21:32:08 +0100 Subject: [eXPlainPMT Developers] Regarding selected menu items Message-ID: <8F475308-A6A1-4DF9-BC1B-E66A59E29F7D@gmx.com> Hi, I was thinking: when viewing/editing a story, shouldn't the "Iterations" menu item be selected when a story has a Iteration, and the "Backlog" menu item, when the story's in the backlog? Rob From svn at explainpmt.com Mon Jan 9 15:37:17 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Mon, 9 Jan 2006 20:37:17 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [140] No menu item is selected when showing a story card Message-ID: <20060109203717.26F35C94A0@thurlow.textdrive.com> Revision: 140 Author: rmannl Date: 2006-01-09 20:37:13 +0000 (Mon, 09 Jan 2006) Log Message: ----------- No menu item is selected when showing a story card StoriesController#show now provides back links to either the backlog or the stories iteration Modified Paths: -------------- trunk/app/controllers/stories_controller.rb trunk/app/views/stories/show.rhtml Modified: trunk/app/controllers/stories_controller.rb =================================================================== --- trunk/app/controllers/stories_controller.rb 2006-01-09 20:16:25 UTC (rev 139) +++ trunk/app/controllers/stories_controller.rb 2006-01-09 20:37:13 UTC (rev 140) @@ -132,6 +132,7 @@ # parameter. def show @story = Story.find(@params['id']) + @selected_main_menu_link = :none @page_title = @story.title end Modified: trunk/app/views/stories/show.rhtml =================================================================== --- trunk/app/views/stories/show.rhtml 2006-01-09 20:16:25 UTC (rev 139) +++ trunk/app/views/stories/show.rhtml 2006-01-09 20:37:13 UTC (rev 140) @@ -1,7 +1,17 @@

<%= "SC#{@story.scid}: #{@story.title}" %>

- (<%= link_to('Edit', :controller => 'stories', :action => 'edit', - :id => @story.id, :project_id => @project.id) %>) + <%= link_to('Edit', :controller => 'stories', :action => 'edit', + :id => @story.id, :project_id => @project.id) %> + +     + + <% if @story.iteration %> + <%= link_to('Back to Iteration', :controller => 'iterations', :action => 'show', + :id => @story.iteration.id, :project_id => @project.id) %> + <% else %> + <%= link_to('Back to Backlog', :controller => 'stories', :project_id => @project.id) %> + <% end %> +

From mannl at gmx.com Mon Jan 9 15:42:58 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Mon, 9 Jan 2006 21:42:58 +0100 Subject: [eXPlainPMT Developers] [SVN commit] [140] No menu item is selected when showing a story card In-Reply-To: <20060109203717.26F35C94A0@thurlow.textdrive.com> References: <20060109203717.26F35C94A0@thurlow.textdrive.com> Message-ID: <6D7E6862-F50E-4E88-B5AB-E51614CA7194@gmx.com> I have no idea why this indent happened. I use soft tabs in my editor. > @story = Story.find(@params['id']) > + @selected_main_menu_link = :none > @page_title = @story.title Rob From svn at explainpmt.com Wed Jan 11 14:29:02 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 11 Jan 2006 19:29:02 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [141] Added constant ALL_FIXTURES to Test::Unit::TestCase which is used as an Message-ID: <20060111192902.DC116C94FB@thurlow.textdrive.com> Revision: 141 Author: jwilger Date: 2006-01-11 19:29:00 +0000 (Wed, 11 Jan 2006) Log Message: ----------- Added constant ALL_FIXTURES to Test::Unit::TestCase which is used as an argument to Test::Unit::TestCase.fixtures to cause the test case to load all fixture files. It may have a very slight negative impact on the speed of the tests (shouldn't really be noticable), but it makes life easier, because you don't have to remember which specific fixture files to load for each test case. If a specific test case requires something else (which would be odd), the "normal" behavior will still work. Modified Paths: -------------- trunk/test/functional/dashboard_controller_test.rb trunk/test/test_helper.rb trunk/test/unit/iteration_test.rb trunk/test/unit/milestone_test.rb trunk/test/unit/project_test.rb trunk/test/unit/story_test.rb trunk/test/unit/user_test.rb Modified: trunk/test/functional/dashboard_controller_test.rb =================================================================== --- trunk/test/functional/dashboard_controller_test.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/functional/dashboard_controller_test.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -5,7 +5,7 @@ class DashboardController; def rescue_action(e) raise e end; end class DashboardControllerTest < Test::Unit::TestCase - fixtures :users, :projects, :projects_users + fixtures ALL_FIXTURES def setup @admin = User.find 1 @user_one = User.find 2 Modified: trunk/test/test_helper.rb =================================================================== --- trunk/test/test_helper.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/test_helper.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -11,6 +11,9 @@ # Add more helper methods to be used by all tests here... + ALL_FIXTURES = [ :iterations, :milestones, :projects_users, :projects, + :stories, :users ] + private def create_common_fixtures(*fixture_names) fixture_names.each do |name| Modified: trunk/test/unit/iteration_test.rb =================================================================== --- trunk/test/unit/iteration_test.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/unit/iteration_test.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../test_helper' class IterationTest < Test::Unit::TestCase - fixtures :iterations, :projects, :stories + fixtures ALL_FIXTURES def setup @project_one = Project.find 1 @iteration_one = Iteration.find 1 @@ -95,4 +95,4 @@ assert !@iteration_five.past? assert @iteration_six.past? end -end \ No newline at end of file +end Modified: trunk/test/unit/milestone_test.rb =================================================================== --- trunk/test/unit/milestone_test.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/unit/milestone_test.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../test_helper' class MilestoneTest < Test::Unit::TestCase - fixtures :milestones + fixtures ALL_FIXTURES def setup @past_milestone1 = Milestone.find 1 Modified: trunk/test/unit/project_test.rb =================================================================== --- trunk/test/unit/project_test.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/unit/project_test.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../test_helper' class ProjectTest < Test::Unit::TestCase - fixtures :projects, :stories, :iterations + fixtures ALL_FIXTURES def setup @project_one = Project.find 1 @@ -127,4 +127,4 @@ def test_backlog assert_equal 1, @project_one.stories.backlog.size end -end \ No newline at end of file +end Modified: trunk/test/unit/story_test.rb =================================================================== --- trunk/test/unit/story_test.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/unit/story_test.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../test_helper' class StoryTest < Test::Unit::TestCase - fixtures :users, :projects, :projects_users, :iterations + fixtures ALL_FIXTURES def setup @user_one = User.find 1 Modified: trunk/test/unit/user_test.rb =================================================================== --- trunk/test/unit/user_test.rb 2006-01-09 20:37:13 UTC (rev 140) +++ trunk/test/unit/user_test.rb 2006-01-11 19:29:00 UTC (rev 141) @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../test_helper' class UserTest < Test::Unit::TestCase - fixtures :users + fixtures ALL_FIXTURES def setup @user_one = User.find 1 @@ -45,4 +45,4 @@ @user_one.valid? assert_nil @user_one.errors[:password] end -end \ No newline at end of file +end From svn at explainpmt.com Wed Jan 11 15:09:03 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 11 Jan 2006 20:09:03 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [142] more test fixture refactoring Message-ID: <20060111200903.6D0E3C947B@thurlow.textdrive.com> Revision: 142 Author: jwilger Date: 2006-01-11 20:09:01 +0000 (Wed, 11 Jan 2006) Log Message: ----------- more test fixture refactoring Modified Paths: -------------- trunk/test/fixtures/iterations.yml trunk/test/fixtures/stories.yml trunk/test/functional/iterations_controller_test.rb trunk/test/unit/iteration_test.rb trunk/test/unit/story_test.rb Modified: trunk/test/fixtures/iterations.yml =================================================================== --- trunk/test/fixtures/iterations.yml 2006-01-11 19:29:00 UTC (rev 141) +++ trunk/test/fixtures/iterations.yml 2006-01-11 20:09:01 UTC (rev 142) @@ -3,7 +3,7 @@ start_date: <%= Date.today %> length: 14 project_id: 1 - budget: 11 + budget: 17 second: id: 2 start_date: <%= Date.today + 14 %> Modified: trunk/test/fixtures/stories.yml =================================================================== --- trunk/test/fixtures/stories.yml 2006-01-11 19:29:00 UTC (rev 141) +++ trunk/test/fixtures/stories.yml 2006-01-11 20:09:01 UTC (rev 142) @@ -22,3 +22,25 @@ title: 'Third Story' status: 1 points: 2 +fourth: + id: 4 + scid: 4 + project_id: 1 + iteration_id: 1 + user_id: 1 + title: 'Fourth Story' + status: 2 + points: 3 + priority: 1 + risk: 1 +fifth: + id: 5 + scid: 5 + project_id: 1 + iteration_id: 1 + user_id: 1 + title: 'Fifth Story' + status: 2 + points: 3 + priority: 1 + risk: 1 Modified: trunk/test/functional/iterations_controller_test.rb =================================================================== --- trunk/test/functional/iterations_controller_test.rb 2006-01-11 19:29:00 UTC (rev 141) +++ trunk/test/functional/iterations_controller_test.rb 2006-01-11 20:09:01 UTC (rev 142) @@ -5,28 +5,15 @@ class IterationsController; def rescue_action(e) raise e end; end class IterationsControllerTest < Test::Unit::TestCase - def setup - Project.destroy_all - User.destroy_all - create_common_fixtures :user_one, :project_one, :story_one, :story_two, - :iteration_one - @project_one.users << @user_one - @story_one.project = @project_one - @story_one.save - @story_two.project = @project_one - @story_two.save - @iteration_one.project = @project_one - @iteration_one.save - @iteration_one.stories << @story_one - @iteration_one.stories << @story_two - @iteration_two = Iteration.create('start_date' => Date.today + 14, - 'length' => 14, 'budget' => 14, - 'project_id' => @project_one.id) + fixtures ALL_FIXTURES + def setup @controller = IterationsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new - @request.session[:current_user] = @user_one + @request.session[:current_user] = User.find 1 + + @project_one = Project.find 1 end def test_index_no_project_id @@ -60,15 +47,15 @@ end def test_show - get :show, 'id' => @iteration_one.id, 'project_id' => @project_one.id + get :show, 'id' => 1, 'project_id' => 1 assert_response :success assert_template 'show' - assert_equal @iteration_one, assigns(:iteration) + assert_equal Iteration.find( 1 ), assigns(:iteration) assert assigns(:stories) end def test_new - get :new, 'project_id' => @project_one.id + get :new, 'project_id' => 1 assert_response :success assert_template 'new' assert assigns(:iteration).class == Iteration @@ -112,38 +99,39 @@ end def test_delete - get :delete, 'id' => @iteration_one.id, 'project_id' => @project_one.id + iteration = Iteration.find 1 + get :delete, 'id' => 1, 'project_id' => 1 assert_redirected_to :controller => 'iterations', :action => 'index', - :project_id => @project_one.id.to_s - assert_equal "The #{@iteration_one.length}-day iteration scheduled to " + - "start on #{@iteration_one.start_date.strftime('%m/%d/%Y')} " + + :project_id => '1' + assert_equal "The #{iteration.length}-day iteration scheduled to " + + "start on #{iteration.start_date.strftime('%m/%d/%Y')} " + "has been deleted. All stories assigned to the iteration " + "(if any) have been moved to the project backlog.", flash[:status] assert_raise(ActiveRecord::RecordNotFound) { - Iteration.find(@iteration_one.id) + Iteration.find iteration.id } assert_equal [], Story.find(:all, :conditions => [ 'iteration_id = ?', - @iteration_one.id ]) + iteration.id ]) end def test_edit - get :edit, 'id' => @iteration_one.id, 'project_id' => @project_one.id + get :edit, 'id' => 1, 'project_id' => 1 assert_response :success assert_template 'edit' - assert_equal @iteration_one, assigns(:iteration) + assert_equal Iteration.find( 1 ), assigns(:iteration) end def test_edit_invalid - @request.session[:edit_iteration] = @iteration_one + @request.session[:edit_iteration] = Iteration.find 1 test_edit assert_nil session[:edit_iteration] end def test_update - post :update, 'id' => @iteration_one.id, 'project_id' => @project_one.id, + post :update, 'id' => 1, 'project_id' => 1, 'iteration' => { 'length' => '10' } assert_response :success assert_template 'layouts/refresh_parent_close_popup' @@ -151,61 +139,56 @@ end def test_update_invalid - post :update, 'id' => @iteration_one.id, 'project_id' => @project_one.id, + post :update, 'id' => 1, 'project_id' => 1, 'iteration' => { 'length' => 'foo' } assert_redirected_to :controller => 'iterations', :action => 'edit', - :id => @iteration_one.id.to_s, - :project_id => @project_one.id.to_s + :id => '1', + :project_id => '1' assert session[:edit_iteration] end def test_move_stories_to_backlog - post :move_stories, 'id' => @iteration_one.id, - 'project_id' => @project_one.id, - 'selected_stories' => [ @story_one.id, @story_two.id ], 'move_to' => 0 + post :move_stories, 'id' => 1, + 'project_id' => 1, + 'selected_stories' => [ 4, 5 ], 'move_to' => 0 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => @iteration_one.id.to_s, - :project_id => @project_one.id.to_s - sc_one = Story.find(@story_one.id) + :id => '1', + :project_id => '1' + sc_one = Story.find( 4 ) assert_nil sc_one.iteration - sc_two = Story.find(@story_two.id) + sc_two = Story.find( 5 ) assert_nil sc_two.iteration assert flash[:status] end def test_move_stories_to_another_iteration - @story_one.status = Story::Status::Defined - @story_one.save - @story_two.status = Story::Status::Defined - @story_two.save - post :move_stories, 'id' => @iteration_one.id, - 'project_id' => @project_one.id, - 'selected_stories' => [@story_one.id, @story_two.id], - 'move_to' => @iteration_two.id + post :move_stories, 'id' => 1, + 'project_id' => 1, + 'selected_stories' => [ 4, 5 ], + 'move_to' => 2 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => @iteration_one.id.to_s, - :project_id => @project_one.id.to_s - sc_one = Story.find(@story_one.id) - assert_equal @iteration_two, sc_one.iteration - sc_two = Story.find(@story_two.id) - assert_equal @iteration_two, sc_two.iteration + :id => '1', + :project_id => '1' + sc_one = Story.find( 4 ) + assert_equal Iteration.find( 2 ), sc_one.iteration + sc_two = Story.find( 5 ) + assert_equal Iteration.find( 2 ), sc_two.iteration assert flash[:status] end def test_move_stories_raises_no_error_if_no_stories_selected assert_nothing_raised do - post :move_stories, :project_id => @project_one.id, - :move_to => @iteration_two.id + post :move_stories, :project_id => 1, + :move_to => 2 end end def test_select_stories - get :select_stories, 'id' => @iteration_one.id, - 'project_id' => @project_one.id + get :select_stories, 'id' => 1, 'project_id' => 1 assert_response :success assert_template 'select_stories' - assert_equal @iteration_one, assigns(:iteration) - assigns['stories'].each do |s| + assert_equal Iteration.find( 1 ), assigns(:iteration) + assigns( :stories ).each do |s| assert_nil s.iteration assert s.status != Story::Status::New assert s.status != Story::Status::Cancelled @@ -213,25 +196,25 @@ end def test_assign_stories - post :assign_stories, 'id' => @iteration_one.id, - 'project_id' => @project_one.id, - 'selected_stories' => [ @story_one.id, @story_two.id ], - 'move_to' => @iteration_two.id + post :assign_stories, 'id' => '1', + 'project_id' => '1', + 'selected_stories' => [ 4, 5 ], + 'move_to' => 2 assert_response :success assert_template 'layouts/refresh_parent_close_popup' - sc_one = Story.find(@story_one.id) - assert_equal @iteration_two, sc_one.iteration - sc_two = Story.find(@story_two.id) - assert_equal @iteration_two, sc_two.iteration + sc_one = Story.find 4 + assert_equal Iteration.find( 2 ), sc_one.iteration + sc_two = Story.find 5 + assert_equal Iteration.find( 2 ), sc_two.iteration assert flash[:status] end def test_assign_stories_not_defined story = @project_one.stories.create('title' => 'undefed story') - post :move_stories, 'project_id' => @project_one.id, - 'selected_stories' => [story.id], 'move_to' => @iteration_one.id + post :move_stories, 'project_id' => 1, + 'selected_stories' => [story.id], 'move_to' => 1 assert_redirected_to :controller => 'stories', :action => 'index', - :project_id => @project_one.id.to_s + :project_id => '1' assert_nil flash[:status] assert flash[:error] end Modified: trunk/test/unit/iteration_test.rb =================================================================== --- trunk/test/unit/iteration_test.rb 2006-01-11 19:29:00 UTC (rev 141) +++ trunk/test/unit/iteration_test.rb 2006-01-11 20:09:01 UTC (rev 142) @@ -17,7 +17,7 @@ end def test_total_points - assert_equal 6, @iteration_one.stories.total_points + assert_equal 12, @iteration_one.stories.total_points end def test_remaining_resources @@ -29,7 +29,7 @@ end def test_remaining_points - assert_equal 3, @iteration_one.stories.remaining_points + assert_equal 9, @iteration_one.stories.remaining_points end def test_iteration_id_of_stories_set_to_null_when_iteration_deleted Modified: trunk/test/unit/story_test.rb =================================================================== --- trunk/test/unit/story_test.rb 2006-01-11 19:29:00 UTC (rev 141) +++ trunk/test/unit/story_test.rb 2006-01-11 20:09:01 UTC (rev 142) @@ -61,7 +61,7 @@ def test_scid_increments_properly story = @project_one.stories.create :title => 'A Story Card' - assert_equal 4, story.scid + assert_equal 6, story.scid project_two = Project.find 2 story = project_two.stories.create :title => 'Another Story Card' From svn at explainpmt.com Wed Jan 11 15:54:29 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 11 Jan 2006 20:54:29 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [143] cleaned up IterationsControllerTest a little bit. Message-ID: <20060111205429.36A30C947D@thurlow.textdrive.com> Revision: 143 Author: jwilger Date: 2006-01-11 20:54:25 +0000 (Wed, 11 Jan 2006) Log Message: ----------- cleaned up IterationsControllerTest a little bit. Modified Paths: -------------- trunk/test/fixtures/iterations.yml trunk/test/fixtures/projects.yml trunk/test/functional/iterations_controller_test.rb Modified: trunk/test/fixtures/iterations.yml =================================================================== --- trunk/test/fixtures/iterations.yml 2006-01-11 20:09:01 UTC (rev 142) +++ trunk/test/fixtures/iterations.yml 2006-01-11 20:54:25 UTC (rev 143) @@ -34,3 +34,21 @@ length: 14 project_id: 1 budget: 11 +past: + id: 7 + start_date: <%= Date.today - 30 %> + length: 14 + project_id: 3 + budget: 11 +current: + id: 8 + start_date: <%= Date.today - 3 %> + length: 14 + project_id: 3 + budget: 11 +future: + id: 9 + start_date: <%= Date.today + 30 %> + length: 14 + project_id: 3 + budget: 11 Modified: trunk/test/fixtures/projects.yml =================================================================== --- trunk/test/fixtures/projects.yml 2006-01-11 20:09:01 UTC (rev 142) +++ trunk/test/fixtures/projects.yml 2006-01-11 20:54:25 UTC (rev 143) @@ -3,4 +3,7 @@ name: 'Project One' second: id: 2 - name: 'Project Two' \ No newline at end of file + name: 'Project Two' +third: + id: 3 + name: 'Project Three' Modified: trunk/test/functional/iterations_controller_test.rb =================================================================== --- trunk/test/functional/iterations_controller_test.rb 2006-01-11 20:09:01 UTC (rev 142) +++ trunk/test/functional/iterations_controller_test.rb 2006-01-11 20:54:25 UTC (rev 143) @@ -11,37 +11,42 @@ @controller = IterationsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new - @request.session[:current_user] = User.find 1 + @request.session[ :current_user ] = User.find 1 @project_one = Project.find 1 + @iteration_one = Iteration.find 1 + @iteration_two = Iteration.find 2 end def test_index_no_project_id get :index assert_redirected_to :controller => 'error', :action => 'index' assert_equal "You attempted to access a view that requires a project to " + - "be selected, but no project id was set in your request.", - flash[:error] + "be selected, but no project id was set in your request.", + flash[ :error ] end def test_index - @project_one.iterations(true).clear - past = add_iteration(@project_one, Date.today - 30, 14) - current = add_iteration(@project_one, Date.today - 3, 14) - future = add_iteration(@project_one, Date.today + 30, 14) - get :index, 'project_id' => @project_one.id + past = Iteration.find 7 + current = Iteration.find 8 + future = Iteration.find 9 + + get :index, 'project_id' => 3 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => current.id.to_s, :project_id => @project_one.id.to_s + :id => '8', :project_id => '3' + current.destroy - get :index, 'project_id' => @project_one.id + get :index, 'project_id' => 3 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => past.id.to_s, :project_id => @project_one.id.to_s + :id => '7', :project_id => '3' + past.destroy - get :index, 'project_id' => @project_one.id + get :index, 'project_id' => 3 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => future.id.to_s, :project_id => @project_one.id.to_s + :id => '9', :project_id => '3' + future.destroy - get :index, 'project_id' => @project_one.id + get :index, 'project_id' => 3 assert_response :success assert_template 'index' end @@ -50,136 +55,130 @@ get :show, 'id' => 1, 'project_id' => 1 assert_response :success assert_template 'show' - assert_equal Iteration.find( 1 ), assigns(:iteration) - assert assigns(:stories) + assert_equal @iteration_one, assigns( :iteration ) + assert assigns( :stories ) end def test_new get :new, 'project_id' => 1 assert_response :success assert_template 'new' - assert assigns(:iteration).class == Iteration - assert assigns(:iteration).new_record? + assert assigns( :iteration ).class == Iteration + assert assigns( :iteration ).new_record? end def test_new_from_invalid - @request.session[:new_iteration] = Iteration.new + @request.session[ :new_iteration ] = Iteration.new test_new - assert_nil session[:new_iteration] + assert_nil session[ :new_iteration ] end def test_create Iteration.destroy_all post :create, 'project_id' => @project_one.id, - 'iteration' => { 'start_date(1i)' => Date.today.year.to_s, - 'start_date(2i)' => Date.today.mon.to_s, - 'start_date(3i)' => Date.today.day.to_s, - 'length' => '14', - 'budget' => '120' } + 'iteration' => { + 'start_date(1i)' => Date.today.year.to_s, + 'start_date(2i)' => Date.today.mon.to_s, + 'start_date(3i)' => Date.today.day.to_s, + 'length' => '14', + 'budget' => '120' + } assert_response :success assert_template 'layouts/refresh_parent_close_popup' assert_equal "A new, 14-day iteration starting on " + - "#{Date.today.strftime('%m/%d/%Y')} has been created.", - flash[:status] + "#{Date.today.strftime('%m/%d/%Y')} has been created.", + flash[ :status ] assert_equal 1, Iteration.count end def test_create_invalid it_count = Iteration.count post :create, 'project_id' => @project_one.id, - 'iteration' => { 'start_date(1i)' => Date.today.year.to_s, - 'start_date(2i)' => Date.today.mon.to_s, - 'start_date(3i)' => Date.today.day.to_s, - 'length' => 'foo', - 'budget' => 'bar' } + 'iteration' => { + 'start_date(1i)' => Date.today.year.to_s, + 'start_date(2i)' => Date.today.mon.to_s, + 'start_date(3i)' => Date.today.day.to_s, + 'length' => 'foo', + 'budget' => 'bar' + } assert_redirected_to :controller => 'iterations', :action => 'new', - :project_id => @project_one.id.to_s - assert session[:new_iteration] + :project_id => @project_one.id.to_s + assert session[ :new_iteration ] assert_equal it_count, Iteration.count end def test_delete - iteration = Iteration.find 1 get :delete, 'id' => 1, 'project_id' => 1 assert_redirected_to :controller => 'iterations', :action => 'index', - :project_id => '1' - assert_equal "The #{iteration.length}-day iteration scheduled to " + - "start on #{iteration.start_date.strftime('%m/%d/%Y')} " + - "has been deleted. All stories assigned to the iteration " + - "(if any) have been moved to the project backlog.", - flash[:status] - assert_raise(ActiveRecord::RecordNotFound) { - Iteration.find iteration.id - } + :project_id => '1' + assert_equal "The #{@iteration_one.length}-day iteration scheduled to " + + "start on #{@iteration_one.start_date.strftime('%m/%d/%Y')} " + + "has been deleted. All stories assigned to the iteration " + + "(if any) have been moved to the project backlog.", + flash[ :status ] + assert_raise( ActiveRecord::RecordNotFound ) do + Iteration.find 1 + end assert_equal [], - Story.find(:all, - :conditions => [ 'iteration_id = ?', - iteration.id ]) + Story.find( :all, :conditions => [ 'iteration_id = ?', 1 ] ) end def test_edit get :edit, 'id' => 1, 'project_id' => 1 assert_response :success assert_template 'edit' - assert_equal Iteration.find( 1 ), assigns(:iteration) + assert_equal @iteration_one, assigns( :iteration ) end def test_edit_invalid - @request.session[:edit_iteration] = Iteration.find 1 + @request.session[ :edit_iteration ] = @iteration_one test_edit - assert_nil session[:edit_iteration] + assert_nil session[ :edit_iteration ] end def test_update post :update, 'id' => 1, 'project_id' => 1, - 'iteration' => { 'length' => '10' } + 'iteration' => { 'length' => '10' } assert_response :success assert_template 'layouts/refresh_parent_close_popup' - assert flash[:status] + assert flash[ :status ] end def test_update_invalid post :update, 'id' => 1, 'project_id' => 1, - 'iteration' => { 'length' => 'foo' } + 'iteration' => { 'length' => 'foo' } assert_redirected_to :controller => 'iterations', :action => 'edit', - :id => '1', - :project_id => '1' - assert session[:edit_iteration] + :id => '1', :project_id => '1' + assert session[ :edit_iteration ] end def test_move_stories_to_backlog - post :move_stories, 'id' => 1, - 'project_id' => 1, - 'selected_stories' => [ 4, 5 ], 'move_to' => 0 + post :move_stories, 'id' => 1, 'project_id' => 1, + 'selected_stories' => [ 4, 5 ], 'move_to' => 0 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => '1', - :project_id => '1' - sc_one = Story.find( 4 ) + :id => '1', :project_id => '1' + sc_one = Story.find 4 assert_nil sc_one.iteration - sc_two = Story.find( 5 ) + sc_two = Story.find 5 assert_nil sc_two.iteration - assert flash[:status] + assert flash[ :status ] end def test_move_stories_to_another_iteration - post :move_stories, 'id' => 1, - 'project_id' => 1, - 'selected_stories' => [ 4, 5 ], - 'move_to' => 2 + post :move_stories, 'id' => 1, 'project_id' => 1, + 'selected_stories' => [ 4, 5 ], 'move_to' => 2 assert_redirected_to :controller => 'iterations', :action => 'show', - :id => '1', - :project_id => '1' - sc_one = Story.find( 4 ) - assert_equal Iteration.find( 2 ), sc_one.iteration - sc_two = Story.find( 5 ) - assert_equal Iteration.find( 2 ), sc_two.iteration - assert flash[:status] + :id => '1', :project_id => '1' + sc_one = Story.find 4 + assert_equal @iteration_two, sc_one.iteration + sc_two = Story.find 5 + assert_equal @iteration_two, sc_two.iteration + assert flash[ :status ] end def test_move_stories_raises_no_error_if_no_stories_selected assert_nothing_raised do - post :move_stories, :project_id => 1, - :move_to => 2 + post :move_stories, :project_id => 1, :move_to => 2 end end @@ -187,7 +186,7 @@ get :select_stories, 'id' => 1, 'project_id' => 1 assert_response :success assert_template 'select_stories' - assert_equal Iteration.find( 1 ), assigns(:iteration) + assert_equal @iteration_one, assigns( :iteration ) assigns( :stories ).each do |s| assert_nil s.iteration assert s.status != Story::Status::New @@ -196,34 +195,24 @@ end def test_assign_stories - post :assign_stories, 'id' => '1', - 'project_id' => '1', - 'selected_stories' => [ 4, 5 ], - 'move_to' => 2 + post :assign_stories, 'id' => '1', 'project_id' => '1', + 'selected_stories' => [ 4, 5 ], 'move_to' => 2 assert_response :success assert_template 'layouts/refresh_parent_close_popup' sc_one = Story.find 4 - assert_equal Iteration.find( 2 ), sc_one.iteration + assert_equal @iteration_two, sc_one.iteration sc_two = Story.find 5 - assert_equal Iteration.find( 2 ), sc_two.iteration - assert flash[:status] + assert_equal @iteration_two, sc_two.iteration + assert flash[ :status ] end def test_assign_stories_not_defined - story = @project_one.stories.create('title' => 'undefed story') + story = @project_one.stories.create 'title' => 'undefed story' post :move_stories, 'project_id' => 1, - 'selected_stories' => [story.id], 'move_to' => 1 + 'selected_stories' => [story.id], 'move_to' => 1 assert_redirected_to :controller => 'stories', :action => 'index', - :project_id => '1' - assert_nil flash[:status] - assert flash[:error] + :project_id => '1' + assert_nil flash[ :status ] + assert flash[ :error ] end - - ### Test Helpers ### - private - - def add_iteration(project, start_date, length) - project.iterations.create('start_date' => start_date, 'length' => length) - end end - From svn at explainpmt.com Wed Jan 11 16:30:48 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 11 Jan 2006 21:30:48 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [144] more test fixture refactoring Message-ID: <20060111213049.0026FC94AF@thurlow.textdrive.com> Revision: 144 Author: jwilger Date: 2006-01-11 21:30:48 +0000 (Wed, 11 Jan 2006) Log Message: ----------- more test fixture refactoring Modified Paths: -------------- trunk/test/functional/milestones_controller_test.rb Modified: trunk/test/functional/milestones_controller_test.rb =================================================================== --- trunk/test/functional/milestones_controller_test.rb 2006-01-11 20:54:25 UTC (rev 143) +++ trunk/test/functional/milestones_controller_test.rb 2006-01-11 21:30:48 UTC (rev 144) @@ -10,19 +10,22 @@ NO_RENDERS = [:delete] ALL_ACTIONS = FULL_PAGES + POPUPS + NO_RENDERS + [:milestones_calendar] + fixtures ALL_FIXTURES + def setup - Project.destroy_all - User.destroy_all - create_common_fixtures :user_one, :project_one, :project_two, - :past_milestone1, :past_milestone2, - :recent_milestone1, :recent_milestone2, - :future_milestone1, :future_milestone2 - @project_one.users << @user_one - @project_two.users << @user_one + @project_one = Project.find 1 + @project_two = Project.find 2 + @past_milestone1 = Milestone.find 1 + @past_milestone2 = Milestone.find 2 + @recent_milestone1 = Milestone.find 3 + @recent_milestone2 = Milestone.find 4 + @future_milestone1 = Milestone.find 5 + @future_milestone2 = Milestone.find 6 + @controller = MilestonesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new - @request.session[:current_user] = @user_one + @request.session[:current_user] = User.find 2 end def test_authentication_required From svn at explainpmt.com Wed Jan 11 16:57:13 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Wed, 11 Jan 2006 21:57:13 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [145] more test fixture refactoring Message-ID: <20060111215713.8C028C94AE@thurlow.textdrive.com> Revision: 145 Author: jwilger Date: 2006-01-11 21:57:10 +0000 (Wed, 11 Jan 2006) Log Message: ----------- more test fixture refactoring Modified Paths: -------------- trunk/test/fixtures/milestones.yml trunk/test/functional/milestones_controller_test.rb trunk/test/unit/project_test.rb Modified: trunk/test/fixtures/milestones.yml =================================================================== --- trunk/test/fixtures/milestones.yml 2006-01-11 21:30:48 UTC (rev 144) +++ trunk/test/fixtures/milestones.yml 2006-01-11 21:57:10 UTC (rev 145) @@ -28,3 +28,13 @@ project_id: 1 name: 'Milestone Six' date: <%= Date.today + 365 %> +seventh: + id: 7 + project_id: 1 + name: 'Milestone Seven' + date: <%= Date.today + 13 %> +eighth: + id: 8 + project_id: 2 + name: 'Milestone Eight' + date: <%= Date.today + 13 %> Modified: trunk/test/functional/milestones_controller_test.rb =================================================================== --- trunk/test/functional/milestones_controller_test.rb 2006-01-11 21:30:48 UTC (rev 144) +++ trunk/test/functional/milestones_controller_test.rb 2006-01-11 21:57:10 UTC (rev 145) @@ -21,6 +21,8 @@ @recent_milestone2 = Milestone.find 4 @future_milestone1 = Milestone.find 5 @future_milestone2 = Milestone.find 6 + @future_milestone3 = Milestone.find 7 + @future_milestone4 = Milestone.find 8 @controller = MilestonesController.new @request = ActionController::TestRequest.new @@ -153,39 +155,25 @@ end def test_milestones_calendar_all_projects - @future_milestone2.project = @project_two - @future_milestone2.date = Date.today + 13 - @future_milestone2.save get :milestones_calendar assert_response :success assert_template '_milestones_calendar' days = empty_milestones_days_array days[0][:milestones] << @future_milestone1 - days[13][:milestones] << @future_milestone2 + days[13][:milestones] << @future_milestone4 + days[13][:milestones] << @future_milestone3 assert_equal days, assigns(:days) assert_equal 'Upcoming Milestones (all projects):', assigns(:calendar_title) end def test_milestones_calendar_one_project - p1 = Project.create('name' => 'A Test Project') - m1 = Milestone.create('name' => 'Milestone One', 'date' => Date.today - 1) - m2 = Milestone.create('name' => 'Milestone Two', 'date' => Date.today) - m3 = Milestone.create('name' => 'Milestone Three', - 'date' => Date.today + 13) - m4 = Milestone.create('name' => 'Milestone Four', - 'date' => Date.today + 14) - p1.milestones << [m1,m2,m3,m4] - p2 = Project.create('name' => 'Another Test Project') - m5 = Milestone.create('name' => 'Milestone Five', 'date' => Date.today + 2) - p2.milestones << m5 - @request.session[:current_user].projects << [p1,p2] - get :milestones_calendar, 'project_id' => p1.id + get :milestones_calendar, 'project_id' => 1 assert_response :success assert_template '_milestones_calendar' days = empty_milestones_days_array - days[0][:milestones] << m2 - days[13][:milestones] << m3 + days[0][:milestones] << @future_milestone1 + days[13][:milestones] << @future_milestone3 assert_equal days, assigns(:days) assert_equal 'Upcoming Milestones:', assigns(:calendar_title) end @@ -194,7 +182,7 @@ process :list, :project_id => @project_one.id, :include => 'future' assert_response :success assert_template '_list' - assert_equal [ @future_milestone1, @future_milestone2 ], + assert_equal [ @future_milestone1, @future_milestone3, @future_milestone2 ], assigns(:milestones) end Modified: trunk/test/unit/project_test.rb =================================================================== --- trunk/test/unit/project_test.rb 2006-01-11 21:30:48 UTC (rev 144) +++ trunk/test/unit/project_test.rb 2006-01-11 21:57:10 UTC (rev 145) @@ -18,6 +18,7 @@ @milestone_four = Milestone.find 4 @milestone_five = Milestone.find 5 @milestone_six = Milestone.find 6 + @milestone_seven = Milestone.find 7 end def test_current_iteration_that_starts_today @@ -87,13 +88,14 @@ end def test_future_milestones - assert_equal [ @milestone_five, @milestone_six ], + assert_equal [ @milestone_five, @milestone_seven, @milestone_six ], @project_one.milestones.future end def test_future_milestones_with_no_future_milestones @milestone_five.destroy @milestone_six.destroy + @milestone_seven.destroy assert @project_one.milestones.future.empty? end From svn at explainpmt.com Thu Jan 12 01:24:30 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Thu, 12 Jan 2006 06:24:30 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [146] Added test coverage for the changes in MainMenu I made (r138-r140) Message-ID: <20060112062430.25823C9452@thurlow.textdrive.com> Revision: 146 Author: rmannl Date: 2006-01-12 06:24:27 +0000 (Thu, 12 Jan 2006) Log Message: ----------- Added test coverage for the changes in MainMenu I made (r138-r140) Modified Paths: -------------- trunk/test/functional/stories_controller_test.rb Modified: trunk/test/functional/stories_controller_test.rb =================================================================== --- trunk/test/functional/stories_controller_test.rb 2006-01-11 21:57:10 UTC (rev 145) +++ trunk/test/functional/stories_controller_test.rb 2006-01-12 06:24:27 UTC (rev 146) @@ -156,4 +156,12 @@ assert flash[:status] assert_nil Story.find(@story_one.id).owner end + + def test_main_menu_has_correct_current_link + # new/edit/view story should have no selected item (class="current") in the MainMenu + for action in [:new, :show, :edit] + get action, 'id' => @story_one.id, 'project_id' => @project_one.id + assert_no_tag :tag => 'a', :attributes => { :class => 'current' }, :ancestor => { :tag => 'ul', :attributes => { :id => 'MainMenu' } } + end + end end From mannl at gmx.com Thu Jan 12 02:03:51 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Thu, 12 Jan 2006 08:03:51 +0100 Subject: [eXPlainPMT Developers] [SVN commit] [146] Added test coverage for the changes in MainMenu I made (r138-r140) In-Reply-To: <20060112062430.25823C9452@thurlow.textdrive.com> References: <20060112062430.25823C9452@thurlow.textdrive.com> Message-ID: <7013F003-FB25-4AB8-B1F9-924A9E298736@gmx.com> Sorry for this TDD violation ("test first"). I'm sometimes not sure to what extent templates should be tested, but I felt this one's legitimate. I ran this test with a revision before my changes (r137) and it failed, and with the latest revision (which includes my changes), and it passed. Rob From johnwilger at gmail.com Thu Jan 12 08:51:56 2006 From: johnwilger at gmail.com (John Wilger) Date: Thu, 12 Jan 2006 08:51:56 -0500 Subject: [eXPlainPMT Developers] [SVN commit] [146] Added test coverage for the changes in MainMenu I made (r138-r140) In-Reply-To: <7013F003-FB25-4AB8-B1F9-924A9E298736@gmx.com> References: <20060112062430.25823C9452@thurlow.textdrive.com> <7013F003-FB25-4AB8-B1F9-924A9E298736@gmx.com> Message-ID: On 1/12/06, Robert C. Mannl wrote: > I ran this test with a revision before my changes (r137) and it > failed, and with the latest revision (which includes my changes), and > it passed. Interesting approach to use when you realize you've forgotten a test. Thanks Robert. -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland From svn at explainpmt.com Thu Jan 12 16:04:00 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Thu, 12 Jan 2006 21:04:00 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [147] Added a test to make sure ownership is removed when a story is moved into the backlog. Message-ID: <20060112210400.62F82C94AF@thurlow.textdrive.com> Revision: 147 Author: rmannl Date: 2006-01-12 21:03:57 +0000 (Thu, 12 Jan 2006) Log Message: ----------- Added a test to make sure ownership is removed when a story is moved into the backlog. Modified Paths: -------------- trunk/test/functional/iterations_controller_test.rb Modified: trunk/test/functional/iterations_controller_test.rb =================================================================== --- trunk/test/functional/iterations_controller_test.rb 2006-01-12 06:24:27 UTC (rev 146) +++ trunk/test/functional/iterations_controller_test.rb 2006-01-12 21:03:57 UTC (rev 147) @@ -159,8 +159,10 @@ :id => '1', :project_id => '1' sc_one = Story.find 4 assert_nil sc_one.iteration + assert_nil sc_one.owner sc_two = Story.find 5 assert_nil sc_two.iteration + assert_nil sc_two.owner assert flash[ :status ] end From mannl at gmx.com Thu Jan 12 16:17:20 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Thu, 12 Jan 2006 22:17:20 +0100 Subject: [eXPlainPMT Developers] [SVN commit] [147] Added a test to make sure ownership is removed when a story is moved into the backlog. In-Reply-To: <20060112210400.62F82C94AF@thurlow.textdrive.com> References: <20060112210400.62F82C94AF@thurlow.textdrive.com> Message-ID: <7BD1093C-C0E0-4F3E-A711-0CDAC715D5AF@gmx.com> This functionality was alredy implemented. I only had to write the test =) See line 210 in story.rb From johnwilger at gmail.com Thu Jan 12 16:32:05 2006 From: johnwilger at gmail.com (John Wilger) Date: Thu, 12 Jan 2006 16:32:05 -0500 Subject: [eXPlainPMT Developers] [SVN commit] [147] Added a test to make sure ownership is removed when a story is moved into the backlog. In-Reply-To: <7BD1093C-C0E0-4F3E-A711-0CDAC715D5AF@gmx.com> References: <20060112210400.62F82C94AF@thurlow.textdrive.com> <7BD1093C-C0E0-4F3E-A711-0CDAC715D5AF@gmx.com> Message-ID: On 1/12/06, Robert C. Mannl wrote: > This functionality was alredy implemented. I only had to write the > test =) Odd. I wrote that card after noticing that that wasn't happening. I'm pretty sure I wasn't drinking heavily at the time, but... ;-) -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland From mannl at gmx.com Thu Jan 12 19:24:43 2006 From: mannl at gmx.com (Robert C. Mannl) Date: Fri, 13 Jan 2006 01:24:43 +0100 Subject: [eXPlainPMT Developers] [SVN commit] [147] Added a test to make sure ownership is removed when a story is moved into the backlog. In-Reply-To: References: <20060112210400.62F82C94AF@thurlow.textdrive.com> <7BD1093C-C0E0-4F3E-A711-0CDAC715D5AF@gmx.com> Message-ID: >> This functionality was alredy implemented. I only had to write the >> test =) > > I'm pretty sure I wasn't drinking heavily at the time, ***but... ;-) > *** I wonder what that means.. :) Rob From svn at explainpmt.com Mon Jan 16 09:56:19 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Mon, 16 Jan 2006 14:56:19 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [148] Tagging release release_20060114.0 Message-ID: <20060116145619.6A2D6C9483@thurlow.textdrive.com> Revision: 148 Author: jwilger Date: 2006-01-16 14:56:18 +0000 (Mon, 16 Jan 2006) Log Message: ----------- Tagging release release_20060114.0 Added Paths: ----------- tags/release_20060114.0/ Copied: tags/release_20060114.0 (from rev 147, trunk) From svn at explainpmt.com Mon Jan 16 09:57:49 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Mon, 16 Jan 2006 14:57:49 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [149] Updated VERSION string for current release Message-ID: <20060116145749.DCF3BC948D@thurlow.textdrive.com> Revision: 149 Author: jwilger Date: 2006-01-16 14:57:49 +0000 (Mon, 16 Jan 2006) Log Message: ----------- Updated VERSION string for current release Modified Paths: -------------- tags/release_20060114.0/app/helpers/application_helper.rb Modified: tags/release_20060114.0/app/helpers/application_helper.rb =================================================================== --- tags/release_20060114.0/app/helpers/application_helper.rb 2006-01-16 14:56:18 UTC (rev 148) +++ tags/release_20060114.0/app/helpers/application_helper.rb 2006-01-16 14:57:49 UTC (rev 149) @@ -19,7 +19,7 @@ # The methods added to this helper will be available to all templates in the application. module ApplicationHelper - VERSION = 'dev trunk' + VERSION = '20060114.0' # Used to determine if the currently logged in user has administrative # privileges From johnwilger at gmail.com Sun Jan 22 14:06:21 2006 From: johnwilger at gmail.com (John Wilger) Date: Sun, 22 Jan 2006 14:06:21 -0500 Subject: [eXPlainPMT Developers] offline for a while Message-ID: Just wanted to let you guys know that I'm going to be offline for possibly a couple of weeks due to the move. More info on my website, shortly. -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland From svn at explainpmt.com Mon Jan 30 23:00:47 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Tue, 31 Jan 2006 04:00:47 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [150] r1215@Zen: eric | 2006-01-30 20:00:06 -0800 Message-ID: <20060131040047.D9610C965E@thurlow.textdrive.com> Revision: 150 Author: edavis Date: 2006-01-31 04:00:45 +0000 (Tue, 31 Jan 2006) Log Message: ----------- r1215 at Zen: eric | 2006-01-30 20:00:06 -0800 Removed 'nil' from the risk groups in stories. Changed 'Medium' to 'Normal' for the risk groups. Made 'Normal' the default risk. Note: One test was found to fail upon update. I will try to fix it in my next commit. test_milestones_calendar_all_projects(MilestonesControllerTest) Modified Paths: -------------- trunk/app/models/story.rb trunk/test/unit/story_test.rb Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge - b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1181 + b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1215 Modified: trunk/app/models/story.rb =================================================================== --- trunk/app/models/story.rb 2006-01-16 14:57:49 UTC (rev 149) +++ trunk/app/models/story.rb 2006-01-31 04:00:45 UTC (rev 150) @@ -152,9 +152,8 @@ end Risks << High = create(1, 'High') - Risks << Medium = create(2, 'Medium') + Risks << Normal = create(2, 'Normal') Risks << Low = create(3, 'Low') - Risks << NA = create(4, '') end # When determining the current value for an aggregation, we need to use the @@ -195,7 +194,7 @@ def after_initialize self.status = Status::New unless self.status self.priority = Priority::NA unless self.priority - self.risk = Risk::NA unless self.risk + self.risk = Risk::Normal unless self.risk end def before_create @@ -234,7 +233,7 @@ end def is_defined? - self.priority != Priority::NA and self.risk != Risk::NA and self.points? + self.priority != Priority::NA and self.points? end def before_save_reset_status Modified: trunk/test/unit/story_test.rb =================================================================== --- trunk/test/unit/story_test.rb 2006-01-16 14:57:49 UTC (rev 149) +++ trunk/test/unit/story_test.rb 2006-01-31 04:00:45 UTC (rev 150) @@ -30,8 +30,7 @@ def test_risk_collection assert_equal( - [ Story::Risk::High, Story::Risk::Medium, Story::Risk::Low, - Story::Risk::NA ], + [ Story::Risk::High, Story::Risk::Normal, Story::Risk::Low ], Story::Risks ) end @@ -48,7 +47,7 @@ def test_risk_default_na story = Story.new - assert_equal Story::Risk::NA, story.risk + assert_equal Story::Risk::Normal, story.risk end def test_return_ids_for_aggregations @@ -56,7 +55,7 @@ story.return_ids_for_aggregations assert_equal Story::Status::New.order, story.status assert_equal Story::Priority::NA.order, story.priority - assert_equal Story::Risk::NA.order, story.risk + assert_equal Story::Risk::Normal.order, story.risk end def test_scid_increments_properly @@ -252,11 +251,9 @@ when 1 name = 'High' when 2 - name = 'Medium' + name = 'Normal' when 3 name = 'Low' - when 4 - name = '' end assert_equal name, r.name end @@ -274,9 +271,8 @@ def test_constants assert_equal Story::Risk.new(1), Story::Risk::High - assert_equal Story::Risk.new(2), Story::Risk::Medium + assert_equal Story::Risk.new(2), Story::Risk::Normal assert_equal Story::Risk.new(3), Story::Risk::Low - assert_equal Story::Risk.new(4), Story::Risk::NA end end From svn at explainpmt.com Mon Jan 30 23:11:16 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Tue, 31 Jan 2006 04:11:16 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [151] r1217@Zen: eric | 2006-01-30 20:10:53 -0800 Message-ID: <20060131041116.2178BC94F5@thurlow.textdrive.com> Revision: 151 Author: edavis Date: 2006-01-31 04:11:13 +0000 (Tue, 31 Jan 2006) Log Message: ----------- r1217 at Zen: eric | 2006-01-30 20:10:53 -0800 Fixed failing test test_milestones_calendar_all_projects (MilestonesControllerTest) Appears that the order the milestones where feed to the array were swapped. Modified Paths: -------------- trunk/test/functional/milestones_controller_test.rb Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge - b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1215 + b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1217 Modified: trunk/test/functional/milestones_controller_test.rb =================================================================== --- trunk/test/functional/milestones_controller_test.rb 2006-01-31 04:00:45 UTC (rev 150) +++ trunk/test/functional/milestones_controller_test.rb 2006-01-31 04:11:13 UTC (rev 151) @@ -160,8 +160,8 @@ assert_template '_milestones_calendar' days = empty_milestones_days_array days[0][:milestones] << @future_milestone1 + days[13][:milestones] << @future_milestone3 days[13][:milestones] << @future_milestone4 - days[13][:milestones] << @future_milestone3 assert_equal days, assigns(:days) assert_equal 'Upcoming Milestones (all projects):', assigns(:calendar_title) From svn at explainpmt.com Mon Jan 30 23:50:23 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Tue, 31 Jan 2006 04:50:23 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [152] r1219@Zen: eric | 2006-01-30 20:49:52 -0800 Message-ID: <20060131045023.D07EBC951F@thurlow.textdrive.com> Revision: 152 Author: edavis Date: 2006-01-31 04:50:21 +0000 (Tue, 31 Jan 2006) Log Message: ----------- r1219 at Zen: eric | 2006-01-30 20:49:52 -0800 If a project has no iterations, the move form on Stories#index is disabled and replaced by 'No iterations to move story cards to' in bright red. Also added in a missing end_form_tag Milestones_controllers_test#test_milestones_calendar_all_projects is now failing again, I believe it may pass/fail based on the system time. Modified Paths: -------------- trunk/app/views/stories/index.rhtml trunk/test/functional/stories_controller_test.rb Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge - b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1217 + b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1219 Modified: trunk/app/views/stories/index.rhtml =================================================================== --- trunk/app/views/stories/index.rhtml 2006-01-31 04:11:13 UTC (rev 151) +++ trunk/app/views/stories/index.rhtml 2006-01-31 04:50:21 UTC (rev 152) @@ -13,9 +13,10 @@ :show_cancelled => 1, :sort => @params['sort']) %> <% end %> <% unless @stories.empty? %> +
+ <% if @project.iterations.current %> <%= start_form_tag(:controller => 'iterations', :action => 'move_stories', :project_id => @project.id) %> -
   Move Selected Story Cards to: + <%= end_form_tag %> + <% else %> + No iterations to move story cards to. + <% end %>
<% sort_header_params = { :controller => 'stories', :action => 'index', :project_id => @project.id Modified: trunk/test/functional/stories_controller_test.rb =================================================================== --- trunk/test/functional/stories_controller_test.rb 2006-01-31 04:11:13 UTC (rev 151) +++ trunk/test/functional/stories_controller_test.rb 2006-01-31 04:50:21 UTC (rev 152) @@ -45,6 +45,16 @@ assert_equal [@story_two, @story_three], assigns(:stories) end + def test_backlog_no_iterations + # Destroy the one iteration + @iteration_one.destroy + assert_equal 0, Iteration.find(:all).length + get :index, 'project_id' => @project_one.id + assert_response :success + assert_template 'index' + assert_tag :tag => "div", :content => "No iterations to move story cards to." + end + def test_show get :show, 'id' => @story_one.id, 'project_id' => @project_one.id assert_response :success From svn at explainpmt.com Mon Jan 30 23:56:32 2006 From: svn at explainpmt.com (svn@explainpmt.com) Date: Tue, 31 Jan 2006 04:56:32 +0000 (GMT) Subject: [eXPlainPMT Developers] [SVN commit] [153] r1221@Zen: eric | 2006-01-30 20:55:26 -0800 Message-ID: <20060131045632.3C854C9505@thurlow.textdrive.com> Revision: 153 Author: edavis Date: 2006-01-31 04:56:30 +0000 (Tue, 31 Jan 2006) Log Message: ----------- r1221 at Zen: eric | 2006-01-30 20:55:26 -0800 Reverting r151 milestones_controller_test test_milestones_calendar_all_projects is acting weird, it will pass one time then fail the next. I think it could be attached to the system time. Modified Paths: -------------- trunk/test/functional/milestones_controller_test.rb Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svk:merge - b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1219 + b310ec42-2ae2-468a-b21b-4ca1e43c3af0:/explainpmt/local:1221 Modified: trunk/test/functional/milestones_controller_test.rb =================================================================== --- trunk/test/functional/milestones_controller_test.rb 2006-01-31 04:50:21 UTC (rev 152) +++ trunk/test/functional/milestones_controller_test.rb 2006-01-31 04:56:30 UTC (rev 153) @@ -160,8 +160,8 @@ assert_template '_milestones_calendar' days = empty_milestones_days_array days[0][:milestones] << @future_milestone1 + days[13][:milestones] << @future_milestone4 days[13][:milestones] << @future_milestone3 - days[13][:milestones] << @future_milestone4 assert_equal days, assigns(:days) assert_equal 'Upcoming Milestones (all projects):', assigns(:calendar_title) From edavis10 at gmail.com Mon Jan 30 23:59:35 2006 From: edavis10 at gmail.com (edavis10@gmail.com) Date: Mon, 30 Jan 2006 20:59:35 -0800 Subject: [eXPlainPMT Developers] [SVN commit] [150] r1215@Zen: eric | 2006-01-30 20:00:06 -0800 In-Reply-To: <20060131040047.D9610C965E@thurlow.textdrive.com> References: <20060131040047.D9610C965E@thurlow.textdrive.com> Message-ID: <43DEEEB7.3000801@gmail.com> svn at explainpmt.com wrote: > Revision: 150 > Author: edavis > Date: 2006-01-31 04:00:45 +0000 (Tue, 31 Jan 2006) > > Log Message: > ----------- > r1215 at Zen: eric | 2006-01-30 20:00:06 -0800 > Removed 'nil' from the risk groups in stories. > Changed 'Medium' to 'Normal' for the risk groups. > Made 'Normal' the default risk. > > Note: One test was found to fail upon update. I will try to fix it in my next > commit. > > test_milestones_calendar_all_projects(MilestonesControllerTest) Sorry, this revision should complete SC2 Eric Davis www.theadmin.org From edavis10 at gmail.com Tue Jan 31 00:01:23 2006 From: edavis10 at gmail.com (Eric Davis) Date: Mon, 30 Jan 2006 21:01:23 -0800 Subject: [eXPlainPMT Developers] [SVN commit] [152] r1219@Zen: eric | 2006-01-30 20:49:52 -0800 In-Reply-To: <20060131045023.D07EBC951F@thurlow.textdrive.com> References: <20060131045023.D07EBC951F@thurlow.textdrive.com> Message-ID: <43DEEF23.2040802@gmail.com> svn at explainpmt.com wrote: > Revision: 152 > Author: edavis > Date: 2006-01-31 04:50:21 +0000 (Tue, 31 Jan 2006) > > Log Message: > ----------- > r1219 at Zen: eric | 2006-01-30 20:49:52 -0800 > If a project has no iterations, the move form on Stories#index is disabled > and replaced by 'No iterations to move story cards to' in bright red. > > Also added in a missing end_form_tag > > Milestones_controllers_test#test_milestones_calendar_all_projects is now > failing again, I believe it may pass/fail based on the system time. > This should complete SC39. Eric Davis www.theadmin.org From edavis10 at gmail.com Tue Jan 31 00:09:52 2006 From: edavis10 at gmail.com (Eric Davis) Date: Mon, 30 Jan 2006 21:09:52 -0800 Subject: [eXPlainPMT Developers] SC33 -- send emails when card added Message-ID: <43DEF120.7010807@gmail.com> I am going to work on this story card. I know it is a low priority but I know I can do it and need to get re-familiarized with the code again. Also depending on the time I might be able to take SC34 also (send emails on updates). DESCRIPTION: This should send an email to all users of a project stating that there has been a new card added. The email should also list the information of the card: Title Status Priority Risk Points Description Correct? ?ED Eric Davis www.theadmin.org