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
helpers do | |
def cycle | |
@_cycle ||= reset_cycle | |
@_cycle = [@_cycle.pop] + @_cycle | |
@_cycle.first | |
end | |
def reset_cycle | |
@_cycle = %w(even odd) | |
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
%table.tickets{:cellpadding => 0, :cellspacing => 0} | |
%thead | |
%tr | |
%th No. | |
%th Summary | |
%th Reporter | |
%th Assignee | |
%th Updated | |
%tbody | |
- reset_cycle |
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
gem 'chriseppstein-compass', '~> 0.4' | |
require 'compass' | |
configure do | |
Compass.configuration do |config| | |
config.project_path = File.dirname(__FILE__) | |
config.sass_dir = File.join('views', 'stylesheets') | |
end | |
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
# 1. Create dirs for unpacking your source code and installing your apps | |
mkdir $HOME/src | |
mkdir $HOME/apps | |
# 2. Install the latest version of git | |
cd $HOME/src | |
wget http://kernel.org/pub/software/scm/git/git-1.6.1.3.tar.gz | |
tar zxvf git-1.6.1.3.tar.gz | |
cd git-1.6.1.3 | |
./configure --prefix=$HOME/apps NO_MMAP=1 |
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 'singleton' | |
class String | |
class TextHelperSingleton | |
include Singleton | |
include ActionView::Helpers::TextHelper | |
end | |
def method_missing(method, *args) |
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
Then /^I should be on the (.+?) page$/ do |page_name| | |
request.request_uri.should == send("#{page_name.downcase.gsub(' ','_')}_path") | |
response.should be_success | |
end | |
Then /^I should be redirected to the (.+?) page$/ do |page_name| | |
request.headers['HTTP_REFERER'].should_not be_nil | |
request.headers['HTTP_REFERER'].should_not == request.request_uri | |
Then "I should be on the #{page_name} page" |
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
Feature: Users cannot access to the system without logging in | |
In order to protect the system from unauthorized access | |
An anonymous user | |
Should not have access to the system | |
Scenario: Visiting the login page | |
Given an anonymous user | |
When I go to the new login page | |
Then I should be on the new login page | |
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
When /^I go to (.+)$/ do |page_name| | |
visit path_to(page_name) | |
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
function sc { | |
if [ -x script/console ]; then | |
script/console | |
else | |
sinatra_rb=`egrep -l "^require.+sinatra.$" *.rb 2>/dev/null` | |
if [ -e $sinatra_rb ]; then | |
irb -r $sinatra_rb | |
else | |
irb | |
fi |
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
# 1. Create dirs for unpacking your source code and installing your apps | |
mkdir $HOME/src | |
mkdir $HOME/apps | |
# 2. Create dir for local python modules | |
mkdir -p $HOME/apps/lib/python2.4/site-packages | |
export PYTHONPATH=$HOME/apps/lib/python2.4/site-packages | |
# 3. Install setuptools python module | |
cd $HOME/src |