mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 09:40:13 +01:00
fix last functional and integration tests after merge and jquery changes
This commit is contained in:
parent
f2d977e12a
commit
0e81706fee
4 changed files with 11 additions and 15 deletions
|
|
@ -22,7 +22,10 @@ class ContextsController < ApplicationController
|
||||||
format.xml { render :xml => current_user.contexts.to_xml( :except => :user_id ) }
|
format.xml { render :xml => current_user.contexts.to_xml( :except => :user_id ) }
|
||||||
format.rss &render_contexts_rss_feed
|
format.rss &render_contexts_rss_feed
|
||||||
format.atom &render_contexts_atom_feed
|
format.atom &render_contexts_atom_feed
|
||||||
format.text { render :action => 'index', :layout => false, :content_type => Mime::TEXT }
|
format.text do
|
||||||
|
@all_contexts = current_user.contexts.all
|
||||||
|
render :action => 'index', :layout => false, :content_type => Mime::TEXT
|
||||||
|
end
|
||||||
format.autocomplete { render :text => for_autocomplete(@active_contexts + @hidden_contexts, params[:term])}
|
format.autocomplete { render :text => for_autocomplete(@active_contexts + @hidden_contexts, params[:term])}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -196,14 +199,14 @@ class ContextsController < ApplicationController
|
||||||
|
|
||||||
def render_contexts_rss_feed
|
def render_contexts_rss_feed
|
||||||
lambda do
|
lambda do
|
||||||
render_rss_feed_for current_user.contexts, :feed => feed_options,
|
render_rss_feed_for current_user.contexts.all, :feed => feed_options,
|
||||||
:item => { :description => lambda { |c| c.summary(count_undone_todos_phrase(c)) } }
|
:item => { :description => lambda { |c| c.summary(count_undone_todos_phrase(c)) } }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_contexts_atom_feed
|
def render_contexts_atom_feed
|
||||||
lambda do
|
lambda do
|
||||||
render_atom_feed_for current_user.contexts, :feed => feed_options,
|
render_atom_feed_for current_user.contexts.all, :feed => feed_options,
|
||||||
:item => { :description => lambda { |c| c.summary(count_undone_todos_phrase(c)) },
|
:item => { :description => lambda { |c| c.summary(count_undone_todos_phrase(c)) },
|
||||||
:author => lambda { |c| nil } }
|
:author => lambda { |c| nil } }
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@source_view = params['_source_view'] || 'project_list'
|
@source_view = params['_source_view'] || 'project_list'
|
||||||
@projects = current_user.projects
|
@projects = current_user.projects.all
|
||||||
@new_project = current_user.projects.build
|
@new_project = current_user.projects.build
|
||||||
if params[:projects_and_actions]
|
if params[:projects_and_actions]
|
||||||
projects_and_actions
|
projects_and_actions
|
||||||
else
|
else
|
||||||
@contexts = current_user.contexts
|
@contexts = current_user.contexts.all
|
||||||
init_not_done_counts(['project'])
|
init_not_done_counts(['project'])
|
||||||
if params[:only_active_with_no_next_actions]
|
if params[:only_active_with_no_next_actions]
|
||||||
@projects = current_user.projects.active.select { |p| count_undone_todos(p) == 0 }
|
@projects = current_user.projects.active.select { |p| count_undone_todos(p) == 0 }
|
||||||
|
|
@ -258,7 +258,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
def render_rss_feed
|
def render_rss_feed
|
||||||
lambda do
|
lambda do
|
||||||
render_rss_feed_for current_user.projects, :feed => feed_options,
|
render_rss_feed_for @projects, :feed => feed_options,
|
||||||
:title => :name,
|
:title => :name,
|
||||||
:item => { :description => lambda { |p| summary(p) } }
|
:item => { :description => lambda { |p| summary(p) } }
|
||||||
end
|
end
|
||||||
|
|
@ -266,7 +266,7 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
def render_atom_feed
|
def render_atom_feed
|
||||||
lambda do
|
lambda do
|
||||||
render_atom_feed_for current_user.projects, :feed => feed_options,
|
render_atom_feed_for @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 } }
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<% current_user.contexts.each do |c| -%>
|
<% @all_contexts.each do |c| -%>
|
||||||
|
|
||||||
<%= c.name.upcase %>
|
<%= c.name.upcase %>
|
||||||
<%= count_undone_todos_phrase_text(c)%>. <%= c.hidden? ? t('contexts.status_hidden') : t('contexts.status_active') %>.
|
<%= count_undone_todos_phrase_text(c)%>. <%= c.hidden? ? t('contexts.status_hidden') : t('contexts.status_active') %>.
|
||||||
|
|
|
||||||
|
|
@ -48,13 +48,6 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
|
||||||
assert_ajax_create_increments_count 'My New Project'
|
assert_ajax_create_increments_count 'My New Project'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_create_project_and_go_to_project_page
|
|
||||||
num_projects = Project.count
|
|
||||||
xhr :post, :create, { :project => {:name => 'Immediate Project Planning Required'}, :go_to_project => 1}
|
|
||||||
assert_js_redirected_to %r{/?projects/\d+}
|
|
||||||
assert_equal num_projects + 1, Project.count
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_create_with_comma_in_name_does_not_increment_number_of_projects
|
def test_create_with_comma_in_name_does_not_increment_number_of_projects
|
||||||
assert_ajax_create_does_not_increment_count 'foo,bar'
|
assert_ajax_create_does_not_increment_count 'foo,bar'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue