diff --git a/tracks/app/models/context.rb b/tracks/app/models/context.rb index b4d29f08..25012d35 100644 --- a/tracks/app/models/context.rb +++ b/tracks/app/models/context.rb @@ -24,7 +24,7 @@ class Context < ActiveRecord::Base end def hidden? - self.hide == true + self.hide == true || self.hide == 1 end def to_param diff --git a/tracks/test/functional/contexts_controller_test.rb b/tracks/test/functional/contexts_controller_test.rb index 75e8bf2d..01fc9dee 100644 --- a/tracks/test/functional/contexts_controller_test.rb +++ b/tracks/test/functional/contexts_controller_test.rb @@ -63,7 +63,7 @@ class ContextsControllerTest < TodoContainerControllerTestBase %w(guid link).each do |node| assert_select node, /http:\/\/test.host\/contexts\/.+/ end - assert_select 'pubDate', /(#{contexts(:agenda).created_at.to_s(:rfc822)}|#{contexts(:library).created_at.to_s(:rfc822)})/ + assert_select 'pubDate', contexts(:agenda).created_at.to_s(:rfc822) end end end diff --git a/tracks/test/functional/projects_controller_test.rb b/tracks/test/functional/projects_controller_test.rb index 8f0260fe..fd760430 100644 --- a/tracks/test/functional/projects_controller_test.rb +++ b/tracks/test/functional/projects_controller_test.rb @@ -117,7 +117,7 @@ class ProjectsControllerTest < TodoContainerControllerTestBase %w(guid link).each do |node| assert_select node, /http:\/\/test.host\/projects\/.+/ end - assert_select 'pubDate', /(#{projects(:timemachine).updated_at.to_s(:rfc822)}|#{projects(:moremoney).updated_at.to_s(:rfc822)})/ + assert_select 'pubDate', projects(:timemachine).updated_at.to_s(:rfc822) end end end diff --git a/tracks/test/functional/todos_controller_test.rb b/tracks/test/functional/todos_controller_test.rb index 48a25efd..fcef3bbd 100644 --- a/tracks/test/functional/todos_controller_test.rb +++ b/tracks/test/functional/todos_controller_test.rb @@ -124,7 +124,7 @@ class TodosControllerTest < Test::Unit::TestCase assert_equal 3, @tagged end - def test_rss_feed_content + def test_find_tagged_withd_content @request.session['user_id'] = users(:admin_user).id get :index, { :format => "rss" } assert_equal 'application/rss+xml; charset=utf-8', @response.headers["Content-Type"] @@ -142,7 +142,7 @@ class TodosControllerTest < Test::Unit::TestCase %w(guid link).each do |node| assert_select node, /http:\/\/test.host\/contexts\/.+/ end - assert_select 'pubDate', /(#{projects(:timemachine).updated_at.to_s(:rfc822)}|#{projects(:moremoney).updated_at.to_s(:rfc822)})/ + assert_select 'pubDate', projects(:timemachine).updated_at.to_s(:rfc822) end end end diff --git a/tracks/test/integration/context_xml_api_test.rb b/tracks/test/integration/context_xml_api_test.rb index b18246ef..450695d4 100644 --- a/tracks/test/integration/context_xml_api_test.rb +++ b/tracks/test/integration/context_xml_api_test.rb @@ -60,7 +60,7 @@ class ContextXmlApiTest < ActionController::IntegrationTest assert_response 200 assert_xml_select 'context' do assert_select 'created-at', /\d{4}+-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/ - assert_select 'hide', 'false' + assert_select 'hide', /false|0/ #TODO: Figure out schema issues assert_select 'id', /\d+/ assert_select 'name', @@context_name assert_select 'position', '3' diff --git a/tracks/test/unit/context_test.rb b/tracks/test/unit/context_test.rb index 39be4697..2a35a75f 100644 --- a/tracks/test/unit/context_test.rb +++ b/tracks/test/unit/context_test.rb @@ -122,13 +122,16 @@ class ContextTest < Test::Unit::TestCase def test_hidden_attr_reader assert !@agenda.hidden? @agenda.hide = true - assert @agenda.hidden? + @agenda.save! + @agenda.reload + assert_equal true, @agenda.hidden? end def test_summary undone_todo_count = '5 actions' assert_equal "
#{undone_todo_count}. Context is Active.
", @agenda.summary(undone_todo_count) @agenda.hide = true + @agenda.save! assert_equal "#{undone_todo_count}. Context is Hidden.
", @agenda.summary(undone_todo_count) end diff --git a/tracks/test/unit/todo_test.rb b/tracks/test/unit/todo_test.rb index 4ef5f891..951508cc 100644 --- a/tracks/test/unit/todo_test.rb +++ b/tracks/test/unit/todo_test.rb @@ -130,6 +130,7 @@ class TodoTest < Test::Unit::TestCase def test_initial_state_is_deferred_when_show_from_in_future t = Todo.new + t.user = users(:admin_user) t.description = 'foo' t.context_id = 1 t.show_from = 1.week.from_now.to_date