fix merge errors and some tests

This commit is contained in:
Reinier Balt 2010-11-09 15:13:22 +01:00
parent 0f525436ff
commit f2d977e12a
7 changed files with 17 additions and 34 deletions

View file

@ -86,17 +86,8 @@ class LoginController < ApplicationController
return unless should_expire_sessions? return unless should_expire_sessions?
# Get expiry time (allow ten seconds window for the case where we have none) # Get expiry time (allow ten seconds window for the case where we have none)
expiry_time = session['expiry_time'] || Time.now + 10 expiry_time = session['expiry_time'] || Time.now + 10
<<<<<<< HEAD
@time_left = expiry_time - Time.now
if @time_left < (10*60) # Session will time out before the next check
@msg = 'login.session_time_out'
else
@msg = ""
end
=======
time_left = expiry_time - Time.now time_left = expiry_time - Time.now
@session_expired = ( time_left < (10*60) ) # Session will time out before the next check @session_expired = ( time_left < (10*60) ) # Session will time out before the next check
>>>>>>> replace old prototype/jrails code for periodic checks and start work on autocomplete and edit projects
end end
end end
respond_to do |format| respond_to do |format|

View file

@ -258,14 +258,15 @@ class ProjectsController < ApplicationController
def render_rss_feed def render_rss_feed
lambda do lambda do
render_rss_feed_for @projects, :feed => feed_options, render_rss_feed_for current_user.projects, :feed => feed_options,
:item => { :title => :name, :description => lambda { |p| summary(p) } } :title => :name,
:item => { :description => lambda { |p| summary(p) } }
end end
end end
def render_atom_feed def render_atom_feed
lambda do lambda do
render_atom_feed_for @projects, :feed => feed_options, render_atom_feed_for current_user.projects, :feed => feed_options,
:item => { :description => lambda { |p| summary(p) }, :item => { :description => lambda { |p| summary(p) },
:title => :name, :title => :name,
:author => lambda { |p| nil } } :author => lambda { |p| nil } }

View file

@ -8,12 +8,6 @@
TracksForm.show_errors(html_for_error_messages()); TracksForm.show_errors(html_for_error_messages());
<% end -%> <% end -%>
/*
if @saved
container_name = 'list-contexts-' + (@context.hidden? ? 'hidden' : 'active')
page.insert_html :bottom, container_name, :partial => 'context_listing', :locals => { :context_listing => @context }
*/
function hide_empty_message() { function hide_empty_message() {
$('contexts-empty-nd').hide(); $('contexts-empty-nd').hide();
} }

View file

@ -70,3 +70,9 @@ Feature: Manage the list of contexts
| state | name | | state | name |
| active | @phone | | active | @phone |
| hidden | @hidden| | hidden | @hidden|
@selenium @wip
Scenario: Cannot add a context with comma in the name
When I go to the contexts page
And I add a new active context "foo, bar"
Then I should see "Name cannot contain the comma"

View file

@ -108,3 +108,8 @@ Feature: Manage the list of projects
When I sort the list by number of tasks When I sort the list by number of tasks
Then the project "very busy" should be above the project "test" Then the project "very busy" should be above the project "test"
@selenium @wip
Scenario: Cannot add a project with comma in the name
When I go to the projects page
And I submit a new project with name "foo,bar"
Then I should see "Name cannot contain the comma"

View file

@ -26,13 +26,6 @@ class ContextsControllerTest < TodoContainerControllerTestBase
assert_ajax_create_does_not_increment_count 'foo,bar' assert_ajax_create_does_not_increment_count 'foo,bar'
end end
def test_create_with_comma_in_name_fails_with_rjs
ajax_create 'foo,bar'
assert_rjs :show, 'status'
# Not working with Rails 2.0 upgrade
# assert_rjs :update, 'status', "<div class=\"ErrorExplanation\" id=\"ErrorExplanation\"><h2>1 error prohibited this record from being saved</h2><p>There were problems with the following fields:</p><ul>Name cannot contain the comma (',') character</ul></div>"
end
def test_rss_feed_content def test_rss_feed_content
login_as :admin_user login_as :admin_user
get :index, { :format => "rss" } get :index, { :format => "rss" }

View file

@ -59,13 +59,6 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
assert_ajax_create_does_not_increment_count 'foo,bar' assert_ajax_create_does_not_increment_count 'foo,bar'
end end
def test_create_with_comma_in_name_fails_with_rjs
ajax_create 'foo,bar'
assert_rjs :show, 'status'
# Not working with Rails 2.0 upgrade
# assert_rjs :update, 'status', "<div class=\"ErrorExplanation\" id=\"ErrorExplanation\"><h2>1 error prohibited this record from being saved</h2><p>There were problems with the following fields:</p><ul>Name cannot contain the comma (',') character</ul></div>"
end
def test_todo_state_is_project_hidden_after_hiding_project def test_todo_state_is_project_hidden_after_hiding_project
p = projects(:timemachine) p = projects(:timemachine)
todos = p.todos.find_in_state(:all, :active) todos = p.todos.find_in_state(:all, :active)
@ -214,8 +207,8 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
login_as :admin_user login_as :admin_user
u = users(:admin_user) u = users(:admin_user)
post :actionize, :state => "active", :format => 'js' post :actionize, :state => "active", :format => 'js'
assert_equal 1, projects(:moremoney).position assert_equal 1, projects(:gardenclean).position
assert_equal 2, projects(:gardenclean).position assert_equal 2, projects(:moremoney).position
assert_equal 3, projects(:timemachine).position assert_equal 3, projects(:timemachine).position
end end