From c89386f4655f9c57d91cb2171d9f8e31c80e9934 Mon Sep 17 00:00:00 2001 From: Drew Neil Date: Thu, 17 Sep 2009 12:27:14 +0100 Subject: [PATCH] Created a failing spec for marking Task complete where bucket = "specific_time" --- spec/controllers/tasks_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/controllers/tasks_controller_spec.rb b/spec/controllers/tasks_controller_spec.rb index 4d03efaca9..2f126527cf 100644 --- a/spec/controllers/tasks_controller_spec.rb +++ b/spec/controllers/tasks_controller_spec.rb @@ -404,6 +404,16 @@ def produce_tasks(user, view) response.should render_template("tasks/complete") end + it "should change task status, expose task as @task, and render [complete] template where task.bucket = 'specific_time'" do + @task = Factory(:task, :completed_at => nil, :user => @current_user, :bucket => "specific_time", :calendar => "01/01/2010") + + xhr :put, :complete, :id => @task.id + @task.reload.completed_at.should_not == nil + assigns[:task].should == @task + assigns[:task_total].should == nil + response.should render_template("tasks/complete") + end + it "should change update tasks sidebar if bucket is not empty" do @task = Factory(:task, :completed_at => nil, :user => @current_user)