From bbf3e95b219bdadab2e694b09384bbe18bb5347d Mon Sep 17 00:00:00 2001 From: Eric Allen Date: Sun, 3 May 2009 23:23:01 -0400 Subject: [PATCH] Pre-filling default tags makes these specs wrong and useless --- spec/controllers/todos_controller_spec.rb | 37 ----------------------- 1 file changed, 37 deletions(-) diff --git a/spec/controllers/todos_controller_spec.rb b/spec/controllers/todos_controller_spec.rb index 3ef2c590..0bd0870c 100644 --- a/spec/controllers/todos_controller_spec.rb +++ b/spec/controllers/todos_controller_spec.rb @@ -1,41 +1,4 @@ require File.dirname(__FILE__) + '/../spec_helper' describe TodosController do - it "should add project's default tags to todos" do - p = mock_model(Project, :new_record_before_save? => false) - p.should_receive(:default_tags).twice.and_return('abcd,efgh') - todo = mock_model(Todo, :save => true, :update_state_from_project => nil, - :tags => mock(:tag_list, :reload => nil)) - todo.stub!(:project_id=) - todo.should_receive(:tag_with).with('abcd,efgh') - projects = mock(:project_list, :find_or_create_by_name => p, :find => [p]) - todos = mock(:todo_list, :build => todo) - - user = mock_model(User, :todos => todos, :projects => projects, :prefs => {}, - :contexts => mock(:context_list, :find => [])) - controller.stub!(:current_user).and_return(user) - controller.stub!(:login_required).and_return(true) - controller.stub!(:set_time_zone).and_return(true) - controller.stub!(:mobile?).and_return(true) - get 'create', :project_name => "zzzz", :tag_list => '', :todo => {} - end - - it "should append project's default tags to todos" do - p = mock_model(Project, :new_record_before_save? => false) - p.should_receive(:default_tags).twice.and_return('abcd,efgh') - todo = mock_model(Todo, :save => true, :update_state_from_project => nil, - :tags => mock(:tag_list, :reload => nil)) - todo.stub!(:project_id=) - todo.should_receive(:tag_with).with('111,222,abcd,efgh') - projects = mock(:project_list, :find_or_create_by_name => p, :find => [p]) - todos = mock(:todo_list, :build => todo) - - user = mock_model(User, :todos => todos, :projects => projects, :prefs => {}, - :contexts => mock(:context_list, :find => [])) - controller.stub!(:current_user).and_return(user) - controller.stub!(:login_required).and_return(true) - controller.stub!(:set_time_zone).and_return(true) - controller.stub!(:mobile?).and_return(true) - get 'create', :project_name => "zzzz", :tag_list => '111,222', :todo => {} - end end