A few minor changes and bug fixes:

* On first user signup, the user no longer needs to login and after signing up. They are automatically logged in.
 * The Projects page was showing the name of the last project listed in the new project form. It is now appropriately blank.
 * When trying to create a new action, an error was occurring trying to update tags if the action failed to save. We now only try to update tags if the action saved. I wonder if we should be using some sort of ActiveRecord transaction here. If anyone knows about this, please contact me.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@481 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-03-22 04:37:20 +00:00
parent 38b2e336a8
commit 5a878b3e84
6 changed files with 11 additions and 5 deletions

View file

@ -136,6 +136,7 @@ class ProjectsController < ApplicationController
@active_projects = @projects.select{ |p| p.active? }
@hidden_projects = @projects.select{ |p| p.hidden? }
@completed_projects = @projects.select{ |p| p.completed? }
@new_project = @user.projects.build
render
end
end

View file

@ -65,8 +65,10 @@ class TodosController < ApplicationController
end
@saved = @todo.save
@todo.tag_with(params[:tag_list],@user)
@todo.reload
if @saved
@todo.tag_with(params[:tag_list],@user)
@todo.reload
end
respond_to do |wants|
wants.html { redirect_to :action => "index" }

View file

@ -80,11 +80,13 @@ class UsersController < ApplicationController
return
end
user.is_admin = true if User.no_users_yet?
first_user_signing_up = User.no_users_yet?
user.is_admin = true if first_user_signing_up
if user.save
@user = User.authenticate(user.login, params['user']['password'])
@user.create_preference
@user.save
session['user_id'] = @user.id if first_user_signing_up
notify :notice, "Signup successful for user #{@user.login}."
redirect_back_or_home
end

View file

@ -9,6 +9,7 @@
<%= render :partial => 'project_state_group', :object => @completed_projects, :locals => { :state => 'completed'} %>
</div>
<% @project = @new_project -%>
<div id="input_box">
<%= link_to_function("Create a new project &#187;",
"Element.toggle('project_new');Form.focusFirstElement('project-form');",

View file

@ -5,6 +5,4 @@ type "user_login", "admin"
type "user_password", "abracadabra"
type "user_password_confirmation", "abracadabra"
click_and_wait "signup"
assert_title 'exact:TRACKS::Login'
include_partial 'login/login', :username => 'admin', :password => 'abracadabra'
assert_title 'exact:TRACKS::List tasks'

View file

@ -8,6 +8,8 @@ type "//div[@id='edit_project_2'] //input[@name='project[name]']", "become a bil
click "//div[@id='edit_project_2'] //input[@value='Update']"
wait_for_not_visible "edit_project_2"
wait_for_visible "project_2"
wait_for_visible "flash"
wait_for_not_visible "flash"
click "css=#project_2 .buttons img.delete_item"
assert_confirmation "Are you sure that you want to delete the project 'become a billionaire'?"
wait_for_visible "flash"