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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
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
<!-- Facebook Conversion Code for Signup success - Fans of Alumni - Website Clicks --> | |
<script>(function() { | |
var _fbq = window._fbq || (window._fbq = []); | |
if (!_fbq.loaded) { | |
var fbds = document.createElement('script'); | |
fbds.async = true; | |
fbds.src = '//connect.facebook.net/en_US/fbds.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(fbds, s); | |
_fbq.loaded = true; |
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
<!-- pulse survey invite code --> | |
<!--#if expr="$bbcpage_survey_go = 1" --> | |
<div lang="en-GB" class="pulse-bar blq-reset" id="pulse-container"> | |
<div id="pulse-q"> | |
<p>Help us to keep our finger on the pulse.</p><p><strong>Do you have 5 minutes to tell us what you think about this site?</strong></p> | |
</div> | |
<ul class="blq-clearfix" id="pulse-a"> | |
<li><a href="/survey/pulse/global/redirect/index.shtml?scope=global&survey=yes&surveyname=<!--#echo var='bbcpage_survey_cookie_value'-->&site=<!--#echo var='bbcpage_surveysite'-->&url=<!--#echo var='bbcpage_surveysite_url'-->&js=yes&uid=<!--#echo var='survey_bbcuid' -->" id="pulse-accept">Yes</a></li> | |
<li id="pulse-reject-container"><a href="/survey/pulse/global/redirect/index.shtml?scope=global&survey=no&surveyname=<!--#echo var='bbcpage_survey_cookie_value'-->&site=<!--#echo var='bbcpage_surveysite'-->&url=<!--#echo var='bbcpage_surveysite_url'-->&js=yes&uid=<!--#echo var='survey_bbcuid' -->" id="pulse-reject">No</a></li> | |
</ul> |
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
[root@pal lib-test]# phing -Dwebapp.name=twitterbridge -Dwebapp.root=/mnt/hgfs/workspace/twitterbridge/webapp/ -f all_tests.xml | |
Buildfile: /mnt/hgfs/workspace/twitterbridge/webapp/php/lib-test/all_tests.xml | |
twitterbridge Tests > dir_setup: | |
twitterbridge Tests > test: | |
[PHP Error] require_once(PHPUnit/Util/Log/XML.php): failed to open stream: No such file or directory [line 22 of /usr/share/pear/phing/tasks/ext/phpunit/phpunit3/XMLPHPUnit3ResultFormatter.php] | |
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Util/Log/XML.php' (include_path='../modules/twitterbridge/models:/usr/share/php/test:/mnt/hgfs/workspace/twitterbridge/webapp/conf:/mnt/hgfs/workspace/twitterbridge/webapp/php/lib-test:/mnt/hgfs/workspace/twitterbridge/webapp/php/lib:/data/WORK/open.bbc.co.uk/htdocs:/data/WORK/open.bbc.co.uk/php/lib:/data/WORK/open.bbc.co.uk/php/modules:/data/WORK/open.bbc.co.uk/php/lang:/data/WORK/open.bbc.co.uk/php/views:/data/WORK/open.bbc.co.uk/conf:/data/WORK/bbc.co.uk/htdocs:/data/WORK/bbc.co.uk/p |
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
# usage (in app dir): | |
# rake rails:template LOCATION=http://gist.github.com/391381.txt | |
gem 'resque', :git => 'git://github.com/defunkt/resque.git' | |
gem 'resque-scheduler' | |
file 'config/resque.yml', <<-FILE | |
development: localhost:6379 | |
test: localhost:6379 | |
staging: redis1.se.github.com:6379 |
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
# usage (in app dir): | |
# rake rails:template LOCATION=http://gist.github.com/398938.txt | |
# make a sensible gitignore | |
file ".gitignore", <<-EOF | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
db/*.sqlite3 |
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
# usage (in app dir): | |
# rake rails:template LOCATION=http://gist.github.com/398938.txt | |
# apply obvious | |
apply "http://gist.github.com/398936.txt" | |
# apply resque | |
apply "http://gist.github.com/391381.txt" | |
# apply auth |
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
# usage (in app dir): | |
# rake rails:template LOCATION=http://gist.github.com/403207.txt | |
### Append edge rails lines to end of Gemfile | |
# get existing file | |
gemfile_contents = File.readlines 'Gemfile' | |
# uncomment edge rails statement (line #6) | |
gemfile_contents[5].sub!('#', '').lstrip! |
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
# usage (in app dir): | |
# rake rails:template LOCATION=http://gist.github.com/404864.txt | |
gem 'redis', '1.0.7' # bugfix for "uninitialized constant Redis::Client::ALIASES" | |
gem 'resque' | |
gem 'resque-scheduler' # non-blocking cron-alternative daemon | |
file "script/install_redis", <<-CODE | |
#!/bin/bash | |
git clone git://github.com/defunkt/resque.git vendor/resque |
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
# usage (in app dir): | |
# rake rails:template LOCATION=http://gist.github.com/406257.txt | |
gem "database_cleaner" | |
group :test do | |
gem "launchy" # So you can do Then show me the page | |
# gem "capybara" # alternative to webrat | |
gem "spork" | |
gem "cucumber-rails" | |
gem "cucumber", "0.7.2" |