- This screencast is for beginning Rails developers but will benefit seasoned veterans
- Cucumber is getting the hype lately because of it's syntax (show Gherkin syntax). Nice syntax comes with a lot of overhead (show file tree to manage feature).
- Wouldn't it be nice to get great syntax in integration tests and only have
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
" Vim color file | |
" Converted from Textmate theme Sunburst using Coloration v0.2.2 (http://github.com/sickill/coloration) | |
set background=dark | |
highlight clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
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
padrino rake spec -e test | |
=> Executing Rake spec ... | |
=> Located unlocked Gemfile for test | |
PostsController | |
- should be successful | |
Account Model | |
- can be created (FAILED - 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
/ Before refactoring | |
#freelancer_nav | |
- if freelancer_signed_in? | |
= link_to "Dashboard", '/freelancers/dashboard' | |
- if current_freelancer.profile.nil? | |
= link_to "New Profile", new_profile_path | |
- else | |
= link_to "My Profile", current_freelancer.profile | |
= link_to "Sign out", destroy_freelancer_session_path | |
- elsif admin_signed_in? |
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
Evan-Machnics-MacBook-Pro:showoff-wrangling-git evan$ showoff serve | |
== Sinatra/1.1.3 has taken the stage on 9090 for development with backup from WEBrick | |
[2011-03-05 23:38:03] INFO WEBrick 1.3.1 | |
[2011-03-05 23:38:03] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10.7.1] | |
[2011-03-05 23:38:03] INFO WEBrick::HTTPServer#start: pid=2553 port=9090 | |
/Users/evan/.rvm/gems/ruby-1.9.2-p180/gems/showoff-0.3.4 | |
/Users/evan/RailsApps/showoff-wrangling-git | |
127.0.0.1 - - [05/Mar/2011 23:38:09] "GET / HTTP/1.1" 200 2652 0.0251 | |
practivate.adobe.com - - [05/Mar/2011:23:38:09 EST] "GET / HTTP/1.1" 200 2652 | |
- -> / |
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 Donation | |
include Mongoid::Document | |
field :success, :type => String | |
field :authorization, :type => String | |
field :message, :type => String | |
field :params, :type => Hash, :default => {} | |
def response=(response) | |
self.success = response.success? | |
self.authorization = response.authorization |
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) user signs in should be successful | |
Failure/Error: page.body.should =~ "Successfully" | |
Rack::Test::Error: | |
No response yet. Request a page first. | |
# ./spec/integration/user_logs_in.rb:12:in `block (2 levels) in <top (required)>' | |
Finished in 0.44836 seconds | |
1 example, 1 failure | |
Ruby version 1.9.2p180, Rails version 3.1.0.beta1, RSpec version 2.6.0.rc6, Capybara version 0.4.1.2 |
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
Started GET "/" for 68.35.219.53 at Wed Aug 03 21:56:34 -0700 2011 | |
Processing by WelcomeController#index as HTML | |
Rendered welcome/index.html.erb within layouts/application (5.1ms) | |
Compiled app/assets/stylesheets/application.css (30ms) (pid 31512) | |
Compiled app/assets/stylesheets/blueprint/ie.css (0ms) (pid 31512) | |
Compiled app/assets/stylesheets/blueprint/plugins/buttons/screen.css (0ms) (pid 31512) | |
Compiled app/assets/stylesheets/blueprint/plugins/fancy-type/screen.css (0ms) (pid 31512) | |
Compiled app/assets/stylesheets/blueprint/plugins/link-icons/screen.css (0ms) (pid 31512) | |
Compiled app/assets/stylesheets/blueprint/plugins/rtl/screen.css (0ms) (pid 31512) | |
Compiled app/assets/stylesheets/blueprint/print.css (0ms) (pid 31512) |
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
upstream example-workers { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out). | |
server unix:/tmp/example.co.uk.socket fail_timeout=0; | |
} | |
server { | |
listen 80; # default; | |
server_name example.co.uk; | |
root /home/example.co.uk/website/public; |
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
# ey-cloud-recipes/cookbooks/redis-yml/recipes/default.rb | |
if ['app_master', 'app'].include?(node[:instance_role]) | |
redis_instance = node['utility_instances'].find { |instance| instance['name'] == 'redis' } | |
if redis_instance | |
node[:applications].each do |app, data| | |
template "/data/#{app}/shared/config/redis.yml"do | |
source 'redis.yml.erb' | |
owner node[:owner_name] |
OlderNewer