Skip to content

Instantly share code, notes, and snippets.

$ script/about
About your application's environment
Ruby version 1.8.6 (universal-darwin9.0)
RubyGems version 1.3.1
Rails version 2.0.5
Active Record version 2.0.5
Action Pack version 2.0.5
Active Resource version 2.0.5
Action Mailer version 2.0.5
Active Support version 2.0.5
# Gotcha! articles_controller.rb is getting loaded twice
# and registering our sweepers twice.
#
# This was the critical hint:
# http://blog.pastie.org/2008/12/passenger-wtf-1-nilcontroller_name-in-sweepers-module.html
mephisto (rails-2.2)$ ruby test/functional/admin/articles_controller_permissions_test.rb
Setting up Admin::SectionsController
Setting up Admin::SectionsController
Loaded suite test/functional/admin/articles_controller_permissions_test
/opt/local/lib/ruby/1.8/test/unit/testcase.rb:64:in `initialize': wrong number of arguments (1 for 0) (ArgumentError)
from /opt/local/lib/ruby/1.8/test/unit/testcase.rb:64:in `new'
from /opt/local/lib/ruby/1.8/test/unit/testcase.rb:64:in `suite'
from /opt/local/lib/ruby/1.8/test/unit/testcase.rb:63:in `catch'
from /opt/local/lib/ruby/1.8/test/unit/testcase.rb:63:in `suite'
from /opt/local/lib/ruby/1.8/test/unit/collector/objectspace.rb:25:in `collect'
from /opt/local/lib/ruby/1.8/test/unit/collector/objectspace.rb:23:in `each_object'
from /opt/local/lib/ruby/1.8/test/unit/collector/objectspace.rb:23:in `collect'
from /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:58
from /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:213:in `[]'
Feature: Logging in and out
Scenario: Log in with valid name and password
Given a site
And a global administator named "sarah" with password "password"
When I try to access the overview page
And I log in as "sarah" with password "password"
Then I should see the overview page
class User
class << self
def authenticate_for_with_ldap(site, login, password)
user = authenticate_for_without_ldap(site, login, password)
if user.nil?
# Look in LDAP for login, create a local user, and return it.
end
user
end
alias_method_chain :authenticate_for, :ldap
Feature: Logging in and out
Before:
Given a site
And a global administator named "sarah" with password "password"
Scenario: Log in with valid name and password
When I try to access the overview page
And I log in as "sarah" with password "password"
Then I should see the overview page
Feature: Logging in and out
Context:
Given a site
And a global administator named "sarah" with password "password"
Scenario: Log in with valid name and password
When I try to access the overview page
And I log in as "sarah" with password "password"
Then I should see the overview page
Feature: Multiple site support
As a Mephisto site owner
I want to host blogs for different people
In order to make gigantic piles of money
Background:
Given a global administrator named "Greg"
And a blog named "Greg's anti-tax rants"
And a customer named "Dr. Bill"
And a blog named "Expensive Therapy" owned by "Dr. Bill"
$ git branch
* master
old/STABLEJAN3105
old/STABLENOV1604
old/cecile-2006-10-23
old/cecile-2006-10-23@11684
old/cecile-2006-10-24
old/cecile-2006-10-24@11976
old/douglas-2006-10-23
old/douglas-2006-10-23@11686
# Generated automatically by CodeRay.
$ coderay_stylesheet
.CodeRay {
background-color: #f8f8f8;
border: 1px solid silver;
font-family: 'Courier New', 'Terminal', monospace;
color: #100;
}
.CodeRay pre { margin: 0px }