Skip to content
Extraits de code Groupes Projets
Valider a7156304 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

make cucumber faster by logging in through a much simpler stubby controller. ...

make cucumber faster by logging in through a much simpler stubby controller.  Save about 1m on my laptop.
parent af654781
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#selected_aspect_contacts.section
.title.no_icon
%h5
- if @aspect_ids.size > 1
- if all_aspects_selected? || @aspect_ids.size > 1
= "#{t('_contacts')}"
- else
= @aspect.name
......
......@@ -13,7 +13,7 @@ Feature: Close Account
Then I should be on the home page
When I go to the new user session page
And I try to sign in
And I try to sign in manually
Then I should be on the new user session page
When I wait for the ajax to finish
Then I should see "Invalid email or password."
......
......@@ -16,6 +16,18 @@ end
When /^I try to sign in$/ do
@me ||= Factory(:user_with_aspect, :getting_started => false)
#page.driver.post(integration_sessions_path(:user_id => @me.id))
page.driver.visit(new_integration_sessions_path(:user_id => @me.id))
And %(I press "Login")
# To save time as compared to:
#When %(I go to the new user session page)
#When %(I fill in "Username" with "#{@me.username}")
#When %(I fill in "Password" with "#{@me.password}")
#When %(I press "Sign in")
end
When /^I try to sign in manually$/ do
When %(I go to the new user session page)
When %(I fill in "Username" with "#{@me.username}")
When %(I fill in "Password" with "#{@me.password}")
......
......@@ -40,6 +40,7 @@ DatabaseCleaner.orm = "active_record"
Cucumber::Rails::World.use_transactional_fixtures = false
require File.join(File.dirname(__FILE__), "database_cleaner_patches")
require File.join(File.dirname(__FILE__), "integration_sessions_controller")
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support", "fake_redis")
require File.join(File.dirname(__FILE__), "..", "..", "spec", "helper_methods")
......
class IntegrationSessionsController < ApplicationController
def new
@user_id = params[:user_id]
render 'features/support/integration_sessions_form'
end
def create
sign_in_and_redirect User.find(params[:user_id])
end
end
#Copypasta from http://openhood.com/rails/rails%203/2010/07/20/add-routes-at-runtime-rails-3/
begin
_routes = Diaspora::Application.routes
_routes.disable_clear_and_finalize = true
_routes.clear!
Diaspora::Application.routes_reloader.paths.each{ |path| load(path) }
_routes.draw do
# here you can add any route you want
post 'integration_sessions' => 'integration_sessions#create', :as => 'integration_sessions'
get 'integration_sessions' => 'integration_sessions#new', :as => 'new_integration_sessions'
end
ActiveSupport.on_load(:action_controller) { _routes.finalize! }
ensure
_routes.disable_clear_and_finalize = false
end
= button_to "Login", integration_sessions_path(:user_id => @user_id)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter