This file contains 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
describe "Sinatra::MyHelpers" do | |
describe "sessions" do | |
before do | |
mock_app { | |
set(:sessions => true) | |
include Sinatra::MyHelpers | |
get '/login' do | |
session[:ok] = "Ok." | |
end |
This file contains 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 "yaml" | |
require "forwardable" | |
require "pp" | |
require "ruby-debug" | |
class Hash | |
def has_nested_key?(key) | |
h = self | |
key.to_s.split('.').each do |segment| | |
return false unless h.key?(segment) |
This file contains 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: Create album | |
Given I am logged in as "pepito" | |
When I go to my profile page | |
... | |
Given /^the user (.*) exists$/ do |login_name| | |
User.find_by_login(login_name) || Factory(:user_with_password, :login => login_name) | |
end | |
Given /^I log in as (.*)$/ do |login_name| |
This file contains 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
# | |
# cucumber.yml | |
# | |
# Filter which features are run with each profile by the file extension | |
webrat: --require features/steps/common --require features/support/webrat_env.rb --exclude selenium.feature --format progress | |
selenium: --require features/steps/common --require features/support/selenium_env.rb --exclude webrat.feature --format progress | |
# | |
# features/support/env.rb |
This file contains 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
default: -r features/support/env.rb -r features/support/plain.rb -r features/step_definitions features/plain | |
selenium: -r features/support/env.rb -r features/support/enhanced.rb -r features/step_definitions features/enhanced |
This file contains 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
-rw-r--r-- 1 deploy deploy 10011 Mar 30 19:46 README | |
-rw-r--r-- 1 deploy deploy 307 Mar 30 19:46 Rakefile | |
drwxr-xr-x 6 deploy deploy 4096 Mar 27 12:45 app | |
drwxr-xr-x 5 deploy deploy 4096 Apr 1 12:23 config | |
drwxr-xr-x 2 deploy deploy 4096 Mar 30 19:46 db | |
drwxr-xr-x 2 deploy deploy 4096 Mar 30 19:46 doc | |
drwxr-xr-x 3 deploy deploy 4096 Mar 30 19:46 lib | |
drwxrwxr-x 2 mongrel deploy 4096 Apr 1 11:28 log | |
drwxr-xr-x 5 deploy deploy 4096 Mar 27 12:52 public | |
drwxr-xr-x 3 deploy deploy 4096 Mar 30 19:46 script |
This file contains 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
# App template for generating acts_as_trivia enable applications | |
# See http://github.com/balinterdi/acts_as_trivia/tree/master | |
def ask_with_default(question, default='') | |
user_answer = ask(question).strip | |
user_answer.empty? ? default : user_answer | |
end | |
# generate a model class | |
model_name_and_attributes = ask_with_default("Define the model in Rails resource generate style. (e.g country name:string population:integer)", "country name:string population:integer") |
This file contains 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
class ControllerHelper | |
include Singleton | |
include ActionView::Helpers | |
end | |
def url_helpers | |
ControllerHelper.instance | |
end | |
This file contains 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
# | |
@wip @users | |
Feature: | |
... |
OlderNewer