This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caches_page:index, :planet_redpoint | |
def expire_cache | |
expire_page :action => :index | |
expire_page :action => :planet_redpoint | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/10 * * * * /usr/bin/curl http://feedpoint.hertler.org/home/expire_cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Show Secret | |
Given a user exists with username: "myuser", password: "secret", password_confirmation: "secret" | |
And a secret exists with user: the user | |
And the user is logged in with myuser/secret | |
When I go to the show page for that secret | |
Then I should see the secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^I should see the secret$/ do | |
secret = model('secret') | |
response.should contain(secret.title) | |
response.should contain(secret.user_name) | |
response.should contain(secret.url) | |
response.should contain(secret.label) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
when /the show page for (.+)/ | |
polymorphic_path(model($1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UserHelpers | |
def current_user_session | |
return @current_user_session if defined?(@current_user_session) | |
@current_user_session = UserSession.find | |
end | |
def current_user | |
return @current_user if defined?(@current_user) | |
@current_user = current_user_session && current_user_session.user | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'generate_password' | |
generate_password = PwFoo::GeneratePassword.new(12, PwFoo::GeneratePassword.LOWER_CASE, PwFoo::GeneratePassword.UPPER_CASE, PwFoo::GeneratePassword.NUMBERS, PwFoo::GeneratePassword.SPECIALS ) | |
my_new_password = generate_password.generate_with_min_strength 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get ready to generate passwords of length *12* with lower case letters and numbers | |
generate_password = PwFoo::GeneratePassword.new(12, PwFoo::GeneratePassword.LOWER_CASE, PwFoo::GeneratePassword.NUMBERS ) | |
# generate password with a minimum strength score of 80 | |
my_new_password = generate_password.generate_with_min_strength 80 | |
# generate password with a minimum strength score of 100 | |
my_new_password = generate_password.generate_with_min_strength 100 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_pw = 'secret' | |
my_pw_score = PwFoo::PasswordStrength.new.calculate_score(my_pw) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# = srand_seed_generator.rb - Random seed generator uses the system time and currently running processes to generate a highly random seed. | |
# | |
# Perry Hertler mailto:[email protected] | |
# | |
# == Example | |
# | |
# my_seed = PwFoo::SrandSeedGenerator.new.get_next_seed | |
module PwFoo | |
require 'digest/md5' | |
OlderNewer