On Fri, Jun 25, 2010 at 01:32:22PM -0400, Jason Guiditta wrote:
> ---
>  src/app/controllers/user_sessions_controller.rb |    2 +-
>  src/app/controllers/users_controller.rb         |    2 +-
>  src/features/authentication.feature             |    4 ++--
>  src/features/step_definitions/authentication.rb |    6 +++---
>  src/features/support/paths.rb                   |    7 +++++++
>  5 files changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/src/app/controllers/user_sessions_controller.rb 
> b/src/app/controllers/user_sessions_controller.rb
> index e67cc1d..4a618a4 100644
> --- a/src/app/controllers/user_sessions_controller.rb
> +++ b/src/app/controllers/user_sessions_controller.rb
> @@ -31,7 +31,7 @@ class UserSessionsController < ApplicationController
>      @user_session = UserSession.new(params[:user_session])
>      if @user_session.save
>        flash[:notice] = "Login successful!"
> -      redirect_back_or_default :controller => 'dashboard'
> +      redirect_back_or_default dashboard_url
>      else
>        render :action => :new
>      end
> diff --git a/src/app/controllers/users_controller.rb 
> b/src/app/controllers/users_controller.rb
> index 3536c0e..19828db 100644
> --- a/src/app/controllers/users_controller.rb
> +++ b/src/app/controllers/users_controller.rb
> @@ -32,7 +32,7 @@ class UsersController < ApplicationController
>      @registration = RegistrationService.new(@user)
>      if @registration.save
>        flash[:notice] = "User registered!"
> -      redirect_back_or_default url_for(:action => :show, :id => @user.id)
> +      redirect_back_or_default user_url(@user)
>      else
>        render :action => :new
>      end
> diff --git a/src/features/authentication.feature 
> b/src/features/authentication.feature
> index 78754b9..12e217b 100644
> --- a/src/features/authentication.feature
> +++ b/src/features/authentication.feature
> @@ -17,7 +17,7 @@ Feature: User authentication
>        | Last name         | Tester               |
>        | Email             | [email protected] |
>      And I press "Create Account"
> -    Then I should be on the account page
> +    Then I should be on testuser's user page
>      And I should see "User registered!"
>      And I should have one private pool named "testuser"
>  
> @@ -26,7 +26,7 @@ Feature: User authentication
>      And I am on the login page
>      When I login
>      Then I should see "Login successful!"
> -    And I should be on the account page
> +    And I should be on the dashboard page
>  
>    Scenario: Log in without password
>      Given I am a registered user
> diff --git a/src/features/step_definitions/authentication.rb 
> b/src/features/step_definitions/authentication.rb
> index 7abcb83..c0d581d 100644
> --- a/src/features/step_definitions/authentication.rb
> +++ b/src/features/step_definitions/authentication.rb
> @@ -28,7 +28,7 @@ When /^I forget to enter my password$/ do
>  end
>  
>  When /^I want to edit my profile$/ do
> -  click_link "Hi, #{user.login}"
> +  click_link "#{user.first_name} #{user.last_name}"
>    response.should contain("User Profile for #{user.login}")
>  end
>  
> @@ -37,6 +37,6 @@ Then /^I should be logged out$/ do
>  end
>  
>  Then /^I should have one private pool named "([^\"]*)"$/ do |login|
> -  PortalPool.find_by_name(login).should_not be_nil
> -  PortalPool.find_by_name(login).permissions.size.should == 1
> +  Pool.find_by_name(login).should_not be_nil
> +  Pool.find_by_name(login).permissions.size.should == 1
>  end
> diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
> index 685669c..1f9a8a3 100644
> --- a/src/features/support/paths.rb
> +++ b/src/features/support/paths.rb
> @@ -20,6 +20,9 @@ module NavigationHelpers
>      when /the login page/
>        login_path
>  
> +    when /^(.*)'s user page$/i
> +       user_path(User.find_by_login($1))
> +
>      when /the account page/
>        account_path
>  
> @@ -38,8 +41,12 @@ module NavigationHelpers
>      when /the pool realms page/
>        pool_realms_path
>  
> +    when /the dashboard page/
> +      dashboard_path
> +
>      when /the pool hardware profiles page/
>        hardware_profiles_pool_path
> +
>      # Add more mappings here.
>      # Here is an example that pulls values out of the Regexp:
>      #
> -- 
> 1.6.2.5
> 
> _______________________________________________
> deltacloud-devel mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/deltacloud-devel

ACK!
s
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to