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
| (rdb:1) p cache_control | |
| {"max-age"=>"0", "private"=>true, "must-revalidate"=>true} | |
| # It's a hash? That's weird... | |
| (rdb:1) p cache_control.class | |
| Rack::Cache::CacheControl | |
| # Oh you dirty liar. Let's check. | |
| (rdb:1) p cache_control.class.ancestors | |
| [Rack::Cache::CacheControl, Hash, Mocha::HashMethods, JSON::Ext::Generator::GeneratorMethods::Hash, Enumerable, Object, Metaclass::ObjectMethods, Mocha::ObjectMethods, PP::ObjectMixin, ActiveSupport::Dependencies::Loadable, JSON::Ext::Generator::GeneratorMethods::Object, Kernel, BasicObject] |
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
| @import "mixins.sass" | |
| @import "normalize" | |
| body | |
| font: $size1 Bitter, serif | |
| line-height: 1.6 | |
| color: $base-color | |
| div#container | |
| position: relative |
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
| source 'http://rubygems.org' | |
| gem 'nesta', '~> 0.9.13' | |
| gem 'haml' | |
| gem 'haml-coderay' | |
| gem 'sass' | |
| gem 'compass' | |
| gem 'sprockets-sass' |
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
| the 'create action' do | |
| def post_create(params = {}) | |
| post :create, invitation: params | |
| end | |
| def valid_params | |
| { email: '[email protected]', first_name: 'First', last_name: 'Last' } | |
| end | |
| it 'should send an email to invite new users' do |
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
| import unittest | |
| POINTS = ('0', '15', '30', '40') | |
| def increment_point(player_points, scorer): | |
| if player_points == ['40', '40']: | |
| scorer_points = 'ADV' | |
| else: |
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
| $.ajax @api_url, | |
| dataType: 'json' | |
| beforeSend: (jqXHR, settings) -> | |
| jqXHR.setRequestHeader('X-Requested-With', 'XMLHttpRequest') | |
| success: (data, textStatus, jqXHR) => | |
| @onDataLoaded(data, textStatus, jqXHR) | |
| callback?() | |
| error: (jqXHR, textStatus, errorThrown) => | |
| @onLoadFailed(jqXHR, textStatus, errorThrown) |
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 CapybaraAssertions | |
| def css_assertion_builder(outcome, selector, text, message) | |
| if text | |
| options = { :text => text } | |
| message ||= "#{outcome} have found '#{selector}' containing '#{text}'" | |
| else | |
| options = {} | |
| message ||= "#{outcome} have found '#{selector}'" | |
| end | |
| is_present = page.has_css?(selector, options) |
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
| def redirect_to_app_when_logged_in | |
| if request.path == '/' && request.referer.blank? && current_user | |
| redirect_to iteration_path('current') | |
| end | |
| 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
| class TasksController < ApplicationController | |
| def complete | |
| # add responder as listener, or could subscribe etc... | |
| # task could be the actual task, or pass through the ID | |
| task.add_subscriber(TaskCompletedResponse.new(self)) | |
| task.add_subscriber(TaskEmail.new) | |
| task.add_subscriber(TaskIndex) | |
| task.complete_by(person) | |
| end |