Skip to content

Instantly share code, notes, and snippets.

View agibralter's full-sized avatar
:shipit:

Aaron Gibralter agibralter

:shipit:
View GitHub Profile
god log listeners
I [2008-10-07 23:30:16] INFO: listener-process stop: RAILS_ENV=staging /home/a/staging.site.com/current/script/workling_starling_client stop
W [2008-10-07 23:30:17] WARN: listener-process stop command exited with non-zero code = 1
W [2008-10-07 23:30:27] WARN: listener-process process still running 10 seconds after stop command returned. Force killing.
I [2008-10-07 23:30:27] INFO: listener-process before_start: deleted pid file (CleanPidFile)
I [2008-10-07 23:30:27] INFO: listener-process start: RAILS_ENV=staging /home/a/staging.site.com/current/script/workling_starling_client start
W [2008-10-07 23:30:27] WARN: listener-process start command exited with non-zero code = 1
{ scopeName = 'source.ruby.cucumber.steps';
fileTypes = ( 'steps.rb' );
patterns = (
{ name = 'keyword';
match = '\b(GivenScenario|Given|When|Then)\b';
},
{ name = 'string.regexp.classic.ruby';
begin = '(?:GivenScenario\s)|(?:Given\s)|(?:When\s)|(?:Then\s)\s*((/))(?![*+{}?])';
end = '((/[eimnosux]*))';
},
#new-user
- form_for @user, :url => users_path do |f|
.email
%label{:for => "email"} email
= f.text_field :email
= f.error_message_on :email
.password
%label{:for => "password"} password
= f.password_field :password
= f.error_message_on :password
Processing UsersController#create (for 127.0.0.1 at 2008-10-14 18:53:56) [POST]
Parameters: {"user"=>{"terms_and_conditions"=>"1", "password_confirmation"=>"password", "gender"=>"", "year"=>"", "password"=>"password", "news"=>"1", "email"=>"bob@fat.com"}, "commit"=>"join the project", "action"=>"create", "controller"=>"users"}
SQL (0.000238) SELECT `email` FROM `users` WHERE (`users`.email = 'bob@fat.com') 
SQL (0.000130) SELECT `email` FROM `users` WHERE (`users`.email = 'bob@fat.com') 
User Create (0.000205) INSERT INTO `users` (`salt`, `questions_count`, `updated_at`, `dob`, `crypted_password`, `state_password`, `gender`, `responses_count`, `multipurpose_code`, `email_verified_at`, `year`, `state_email`, `display_name`, `login`, `email`, `created_at`, `news`) VALUES('c0d1e5cfdsa159229f753baf5b72dbb865e249e2', 0, '2008-10-14 22:53:56', NULL, 'c8398e31f1d73249902dfds273abf165da1559a0', 'known', '', 0, '9fd5aded6db6b8fps0b7ea9a3503
- fields_for @user do |f|
.email
%label{:for => "email"} email
= f.text_field :email
= f.error_message_on :email
.password
%label{:for => "password"} password
= f.password_field :password
map.resources :settings
settings.namespace do |setting|
setting.resources :units
setting.resources :groups
end
end
class Settings::Units < SettingsController
end
class Settings::Groups < SettingsController
When %r{^'(.*?)' deletes his welcome email$} do |user_email|
to_remove = nil
ActionMailer::Base.deliveries.each do |email|
email_msg = email.to_s.gsub("=\n", '')
next unless email_msg =~ Regexp.new("To: #{user_email}")
if email_msg =~ /.*http:\/\/.*?(\/reset_password\/[\w]+).*/mi
to_remove = email
break
end
end
class User < ActiveRecord::Base
# ...
attr_accessor :password, :password_confirmation
attr_accessible :login, :email, :password, :password_confirmation
state_machine :state_email, :initial => 'fresh' do
before_transition :to => 'unverified', :do => :make_email_verification_code
before_transition :to => 'verified', :do => :set_email_verified_attributes
Feature: a user signing up # features/users/signup.feature
As a user
I want a smooth sign up process
So ...
Scenario: the user sees the form # features/users/signup.feature:7
When the visitor goes to '/signup' # features/steps/general_steps.rb:49
Then the visitor should see the signup form # features/steps/users/signup_steps.rb:1
Scenario: a successful signup # features/users/signup.feature:11
class Post < ActiveRecord::Base
filter :active, :conditions => { :active => true }
filter :mine, lambda { |user_id| {:conditions => {:user_id => user_id}} }
sort :date_desc, :order => "date DESC"
sort :date_asc, :order => "date ASC"
end